Skip to content

Commit

Permalink
Test expectation via wrong parameter
Browse files Browse the repository at this point in the history
+ fix test that caused NPE with -Drun.javac ...
+ also add more JDK versions to test infra for -Drun.javac
  • Loading branch information
stephan-herrmann committed Apr 11, 2024
1 parent 50880a0 commit c553a5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ static String versionFromRawVersion(String rawVersion, String javacPathName) {
return JavaCore.VERSION_19;
} else if(rawVersion.startsWith("20")) {
return JavaCore.VERSION_20;
} else if(rawVersion.startsWith("21")) {
return JavaCore.VERSION_21;
} else if(rawVersion.startsWith("22")) {
return JavaCore.VERSION_22;
} else {
throw new RuntimeException("unknown javac version: " + rawVersion);
}
Expand Down Expand Up @@ -559,6 +563,11 @@ static int minorFromRawVersion (String version, String rawVersion) {
return 0200;
}
}
if (version == JavaCore.VERSION_22) {
if ("22".equals(rawVersion)) {
return 0000;
}
}
throw new RuntimeException("unknown raw javac version: " + rawVersion);
}
// returns 0L if everything went fine; else the lower word contains the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void testConflictWithUnnamedModule() {
" }\n" +
"}"
};
runner.expectedErrorString =
runner.expectedCompilerLog =
"----------\n" +
"1. ERROR in X.java (at line 3)\n" +
" String s = org.xml.sax.helpers.NamespaceSupport.XMLNS;\n" +
Expand Down

0 comments on commit c553a5d

Please sign in to comment.