You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2019/03/20 13:14:31 UTC

[sling-org-apache-sling-commons-compiler] branch master updated: SLING-8322 - Upgrade to version of ECJ that supports Java 11

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-compiler.git


The following commit(s) were added to refs/heads/master by this push:
     new ae8672e  SLING-8322 - Upgrade to version of ECJ that supports Java 11
ae8672e is described below

commit ae8672e9c47b5e2153a22e904c3ef420322949ac
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Mar 20 14:12:21 2019 +0100

    SLING-8322 - Upgrade to version of ECJ that supports Java 11
---
 pom.xml                                                            | 2 +-
 .../apache/sling/commons/compiler/impl/EclipseJavaCompiler.java    | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index b1ef9e0..732451b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,7 +93,7 @@
         <dependency>
             <groupId>org.eclipse.jdt</groupId>
             <artifactId>ecj</artifactId>
-            <version>3.13.100</version> <!-- this is the version shipped in Oxygen .2 -->
+            <version>3.16.0</version> <!-- this is the version shipped in 2018-12/4.10.0 -->
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
diff --git a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
index 564b232..40e4cab 100644
--- a/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
+++ b/src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java
@@ -237,13 +237,14 @@ public class EclipseJavaCompiler implements JavaCompiler {
     }
 
     private String adjustJavaVersion(String javaVersion) {
-        // use latest supported version (Java 9) in case the given java version is not supported by ECJ yet
+        // use latest supported version (Java 11) in case the given java version is not supported by ECJ yet
         if (CompilerOptions.versionToJdkLevel(javaVersion) == 0) {
+            String latestSupportedVersion = CompilerOptions.VERSION_11;
             // only log once per invalid javaVersion
             if (!warningEmittedForUnsupportedJavaVersion.contains(javaVersion) && warningEmittedForUnsupportedJavaVersion.add(javaVersion)) {
-                logger.warn("Using unsupported java version '{}', assuming latest supported version '{}'", javaVersion, CompilerOptions.VERSION_9);
+                logger.warn("Using unsupported java version '{}', assuming latest supported version '{}'", javaVersion, latestSupportedVersion);
             }
-            return CompilerOptions.VERSION_9;
+            return latestSupportedVersion;
         }
         return javaVersion;
     }