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

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

commit 096e13459dc74760510d3abe2102810cb7566c1c
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Apr 29 09:03:32 2024 +0100

    Add support for Java 23
---
 java/org/apache/jasper/compiler/JDTCompiler.java | 11 ++++++++---
 webapps/docs/changelog.xml                       | 11 +++++++++++
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java 
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 16bf7060f7..e5b5d1a278 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -322,10 +322,12 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
             } else if (opt.equals("21")) {
                 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_21);
             } else if (opt.equals("22")) {
+                settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_22);
+            } else if (opt.equals("23")) {
                 // Constant not available in latest ECJ version shipped with
                 // Tomcat. May be supported in a snapshot build.
                 // This is checked against the actual version below.
-                settings.put(CompilerOptions.OPTION_Source, "22");
+                settings.put(CompilerOptions.OPTION_Source, "23");
             } else {
                 log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", 
opt));
                 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_17);
@@ -400,11 +402,14 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
                 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_21);
                 settings.put(CompilerOptions.OPTION_Compliance, 
CompilerOptions.VERSION_21);
             } else if (opt.equals("22")) {
+                settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_22);
+                settings.put(CompilerOptions.OPTION_Compliance, 
CompilerOptions.VERSION_22);
+            } else if (opt.equals("23")) {
                 // Constant not available in latest ECJ version shipped with
                 // Tomcat. May be supported in a snapshot build.
                 // This is checked against the actual version below.
-                settings.put(CompilerOptions.OPTION_TargetPlatform, "22");
-                settings.put(CompilerOptions.OPTION_Compliance, "22");
+                settings.put(CompilerOptions.OPTION_TargetPlatform, "23");
+                settings.put(CompilerOptions.OPTION_Compliance, "23");
             } else {
                 log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", 
opt));
                 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_17);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 6e0838465d..53f60a70d2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -196,6 +196,17 @@
       </scode>
     </changelog>
   </subsection>
+  <subsection name="Jasper">
+    <changelog>
+      <add>
+        Add support for specifying Java 23 (with the value <code>23</code>) as
+        the compiler source and/or compiler target for JSP compilation. If used
+        with an Eclipse JDT compiler version that does not support these 
values,
+        a warning will be logged and the default will used.
+        (markt)
+      </add>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <update>


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

Reply via email to