Skip to content

Commit

Permalink
Try to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
slachiewicz committed Dec 25, 2024
1 parent 70343c3 commit 8d5b80c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ public CompilerResult performCompile(CompilerConfiguration config) throws Compil
getLog().debug("Using JSR-199 EclipseCompiler");
// ECJ JSR-199 compiles against the latest Java version it supports if no source
// version is given explicitly. BatchCompiler uses 1.3 as default. So check
// whether a source version is specified, and if not supply 1.3 explicitly.
// whether a source version is specified, and if not supply 8 explicitly.
if (!haveSourceOrReleaseArgument(args)) {
getLog().debug("ecj: no source level nor release specified, defaulting to Java 1.3");
getLog().debug("ecj: no source level nor release specified, defaulting to Java 8");
args.add("-source");
args.add("1.3");
args.add("8");
}

// Also check for the encoding. Could have been set via the CompilerConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,21 @@ protected int expectedWarnings() {

@Override
protected Collection<String> expectedOutputFiles() {
String javaVersion = getJavaVersion();
if (javaVersion.contains("9.0")
|| javaVersion.contains("11")
|| javaVersion.contains("17")
|| javaVersion.contains("21")
|| javaVersion.contains("23")) {
return Arrays.asList(
"org/codehaus/foo/Deprecation.class",
"org/codehaus/foo/ExternalDeps.class",
"org/codehaus/foo/Person.class");
}
return Arrays.asList(
"org/codehaus/foo/Deprecation.class",
"org/codehaus/foo/ExternalDeps.class",
"org/codehaus/foo/Person.class",
"org/codehaus/foo/ReservedWord.class"
// "org/codehaus/foo/Bad.class", // This one has no class file generated as it's one big
// issue
// "org/codehaus/foo/UnknownSymbol.class",
// "org/codehaus/foo/RightClassname.class"
);
"org/codehaus/foo/ReservedWord.class");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,27 @@ protected String getRoleHint() {

@Override
protected int expectedErrors() {
return 6;
return 5;
}

@Override
protected int expectedWarnings() {
return 1;
return 0;
}

@Override
protected Collection<String> expectedOutputFiles() {
String javaVersion = getJavaVersion();
if (javaVersion.contains("9.0")
|| javaVersion.contains("11")
|| javaVersion.contains("17")
|| javaVersion.contains("21")
|| javaVersion.contains("23")) {
return Arrays.asList(
"org/codehaus/foo/Deprecation.class",
"org/codehaus/foo/ExternalDeps.class",
"org/codehaus/foo/Person.class");
}
return Arrays.asList(
"org/codehaus/foo/Deprecation.class",
"org/codehaus/foo/ExternalDeps.class",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,27 @@ protected String getRoleHint() {

@Override
protected int expectedErrors() {
return 4;
return 5;
}

@Override
protected int expectedWarnings() {
return 2;
return 1;
}

@Override
protected Collection<String> expectedOutputFiles() {
String javaVersion = getJavaVersion();
if (javaVersion.contains("9.0")
|| javaVersion.contains("11")
|| javaVersion.contains("17")
|| javaVersion.contains("21")
|| javaVersion.contains("23")) {
return Arrays.asList(
"org/codehaus/foo/Deprecation.class",
"org/codehaus/foo/ExternalDeps.class",
"org/codehaus/foo/Person.class");
}
return Arrays.asList(
"org/codehaus/foo/Deprecation.class",
"org/codehaus/foo/ExternalDeps.class",
Expand Down

0 comments on commit 8d5b80c

Please sign in to comment.