(tomcat) 02/02: Add Java 28 support for JSP compilation (if JDT supports it)

[email protected]
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <[email protected]>
This is an automated email from the ASF dual-hosted git repository.

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

commit 10f228f408bb51d8b24b3413007a5c607d750d90
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jul 1 14:33:09 2026 +0100

    Add Java 28 support for JSP compilation (if JDT supports it)
---
 java/org/apache/jasper/compiler/JDTCompiler.java | 12 ++++++++++++
 webapps/docs/changelog.xml                       |  7 +++++++
 2 files changed, 19 insertions(+)

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java
index c2dc42facc..be7ed13959 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -324,6 +324,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, "27");
+                case "28" ->
+                        // 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, "28");
                 default -> {
                     log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", opt));
                     settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_21);
@@ -439,6 +444,13 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler {
                     settings.put(CompilerOptions.OPTION_TargetPlatform, "27");
                     settings.put(CompilerOptions.OPTION_Compliance, "27");
                 }
+                case "28" -> {
+                    // 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, "28");
+                    settings.put(CompilerOptions.OPTION_Compliance, "28");
+                }
                 default -> {
                     log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", opt));
                     settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_21);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 205830b422..35745b62b4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -351,6 +351,13 @@
         <code>doEndTag()</code> were incorrectly re-used. This fix prevents tags
         from being re-used if such an exception occurs. (markt)
       </fix>
+      <add>
+        Add support for specifying Java 28 (with the value <code>28</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 be used.
+        (markt)
+      </add>
     </changelog>
   </subsection>
   <subsection name="Cluster">
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.