Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Java15 build #89

Merged
merged 2 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ cache:
branches:
except:
- gh-pages
notifications:
email:
- [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public String[] createCommandLine( CompilerConfiguration config )

public static String[] buildCompilerArguments( CompilerConfiguration config, String[] sourceFiles )
{
List<String> args = new ArrayList<String>();
List<String> args = new ArrayList<>();

// ----------------------------------------------------------------------
// Set output
Expand Down Expand Up @@ -668,7 +668,7 @@ private static CompilerResult compileInProcess0( Class<?> javacClass, String[] a
static List<CompilerMessage> parseModernStream( int exitCode, BufferedReader input )
throws IOException
{
List<CompilerMessage> errors = new ArrayList<CompilerMessage>();
List<CompilerMessage> errors = new ArrayList<>();

String line;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ protected String getRoleHint()
protected int expectedErrors()
{
String javaVersion = getJavaVersion();
if (javaVersion.contains("9.0")||javaVersion.contains("11")||javaVersion.contains("14")){
if (javaVersion.contains("9.0")||javaVersion.contains("11")||javaVersion.contains("14")||javaVersion.contains("15")){
// lots of new warnings about obsoletions for future releases
return 5;
}

// javac output changed for misspelled modifiers starting in 1.6...they now generate 2 errors per occurrence, not one.
if ( "1.5".compareTo( javaVersion ) < 0 )
{
Expand All @@ -80,7 +79,7 @@ protected int expectedErrors()
protected int expectedWarnings()
{
String javaVersion = getJavaVersion();
if (javaVersion.contains("9.0")||javaVersion.contains("11")||javaVersion.contains("14")){
if (javaVersion.contains("9.0")||javaVersion.contains("11")||javaVersion.contains("14")||javaVersion.contains("15")){
return 1;
}
if (javaVersion.contains("9.0")){
Expand Down Expand Up @@ -115,6 +114,9 @@ public String getTargetVersion()
if (javaVersion.contains("14")){
return "14";
}
if (javaVersion.contains("15")){
return "15";
}
return super.getTargetVersion();
}

Expand All @@ -134,13 +136,17 @@ public String getSourceVersion()
{
return "14";
}
if (javaVersion.contains("15"))
{
return "15";
}
return super.getTargetVersion();
}

protected Collection<String> expectedOutputFiles()
{
String javaVersion = getJavaVersion();
if (javaVersion.contains("9.0")||javaVersion.contains("11")||javaVersion.contains("14"))
if (javaVersion.contains("9.0")||javaVersion.contains("11")||javaVersion.contains("14")||javaVersion.contains("15"))
{
return Arrays.asList( new String[]{ "org/codehaus/foo/Deprecation.class", "org/codehaus/foo/ExternalDeps.class",
"org/codehaus/foo/Person.class"} );
Expand Down