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 333d0f6a5ad9e51cbc4bd85c5d1f3e2c4c92f9be
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Jun 26 14:40:29 2024 +0100

    Add Java 24 support
---
 java/org/apache/jasper/compiler/JDTCompiler.java | 11 +++++++++++
 webapps/docs/changelog.xml                       |  7 +++++++
 2 files changed, 18 insertions(+)

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java 
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 2ea9e5d518..a9e6347665 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -325,6 +325,11 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
                 // Tomcat. May be supported in a snapshot build.
                 // This is checked against the actual version below.
                 settings.put(CompilerOptions.OPTION_Source, "23");
+            } else if (opt.equals("24")) {
+                // 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, "24");
             } else {
                 log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", 
opt));
                 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_17);
@@ -407,6 +412,12 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
                 // This is checked against the actual version below.
                 settings.put(CompilerOptions.OPTION_TargetPlatform, "23");
                 settings.put(CompilerOptions.OPTION_Compliance, "23");
+            } else if (opt.equals("24")) {
+                // 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, "24");
+                settings.put(CompilerOptions.OPTION_Compliance, "24");
             } 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 6b78d26d0f..0997747755 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -170,6 +170,13 @@
         <code>ELException</code> when an object is coerced to a String using
         <code>ExpressionFactory.coerceToType()</code>. (markt)
       </fix>
+      <add>
+        Add support for specifying Java 24 (with the value <code>24</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">


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

Reply via email to