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

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit ea57ae94edfd12319a4bf8f88d38bb0f469a7d07
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Jan 3 11:23:34 2022 +0000

    Fix Java 17 compilation after revert of ECJ update
---
 java/org/apache/jasper/compiler/JDTCompiler.java | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java 
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 69c6e05..2e361f2 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -312,7 +312,10 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
             } else if(opt.equals("16")) {
                 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_16);
             } else if(opt.equals("17")) {
-                settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_17);
+                // Constant not available in latest ECJ version that runs on
+                // Java 8.
+                // This is checked against the actual version below.
+                settings.put(CompilerOptions.OPTION_Source, "17");
             } else if (opt.equals("18")) {
                 // Constant not available in latest ECJ version shipped with
                 // Tomcat. May be supported in a snapshot build.
@@ -377,8 +380,11 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
                 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_16);
                 settings.put(CompilerOptions.OPTION_Compliance, 
CompilerOptions.VERSION_16);
             } else if(opt.equals("17")) {
-                settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_17);
-                settings.put(CompilerOptions.OPTION_Compliance, 
CompilerOptions.VERSION_17);
+                // Constant not available in latest ECJ version that runs on
+                // Java 8.
+                // This is checked against the actual version below.
+                settings.put(CompilerOptions.OPTION_TargetPlatform, "17");
+                settings.put(CompilerOptions.OPTION_Compliance, "17");
             } else if (opt.equals("18")) {
                 // Constant not available in latest ECJ version shipped with
                 // Tomcat. May be supported in a snapshot build.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to