Skip to content

Commit

Permalink
fix Java15 build (#89)
Browse files Browse the repository at this point in the history
* fix java15 build

Signed-off-by: olivier lamy <[email protected]>

* avoid travis spam

Signed-off-by: olivier lamy <[email protected]>
  • Loading branch information
olamy authored Aug 14, 2020
1 parent 671ad54 commit d900082
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
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

0 comments on commit d900082

Please sign in to comment.