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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 41a9a5b035 Add support for Java 19 JSP compilation (if JDT supports it)
41a9a5b035 is described below

commit 41a9a5b035d665d59fafb41e114717d747fae2b1
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jun 2 18:21:31 2022 +0100

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

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java 
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 2e361f28b0..5bbae6b5fe 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -321,6 +321,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, "18");
+            } else if (opt.equals("19")) {
+                // 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, "19");
             } else {
                 log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", 
opt));
                 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_1_8);
@@ -391,6 +396,12 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
                 // This is checked against the actual version below.
                 settings.put(CompilerOptions.OPTION_TargetPlatform, "18");
                 settings.put(CompilerOptions.OPTION_Compliance, "18");
+            } else if (opt.equals("19")) {
+                // 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, "19");
+                settings.put(CompilerOptions.OPTION_Compliance, "19");
             } else {
                 log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", 
opt));
                 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_1_8);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ba51845d53..132af3f39b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,17 @@
   issues do not "pop up" wrt. others).
 -->
 <section name="Tomcat 9.0.65 (remm)" rtext="in development">
+  <subsection name="Jasper">
+    <changelog>
+      <add>
+        Add support for specifying Java 19 (with the value <code>19</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>
 </section>
 <section name="Tomcat 9.0.64 (remm)" rtext="in progress">
   <subsection name="Catalina">


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

Reply via email to