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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 8053cd3  Add support for compiling JSPs for Java 18
8053cd3 is described below

commit 8053cd3a30d4236b86fa6241c5ebd36726d58c9f
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Sun Jan 2 16:14:23 2022 +0000

    Add support for compiling JSPs for Java 18
---
 java/org/apache/jasper/compiler/JDTCompiler.java | 13 +++++++++++++
 webapps/docs/changelog.xml                       |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java 
b/java/org/apache/jasper/compiler/JDTCompiler.java
index 304aafd..1afc4dc 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -364,6 +364,13 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
                 // Java 7.
                 // 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 that runs on
+                // Java 7.
+                // Constant not available in latest stable ECJ version.
+                // May be supported in a snapshot build.
+                // This is checked against the actual version below.
+                settings.put(CompilerOptions.OPTION_Source, "18");
             } else {
                 log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", 
opt));
                 settings.put(CompilerOptions.OPTION_Source, 
CompilerOptions.VERSION_1_7);
@@ -449,6 +456,12 @@ public class JDTCompiler extends 
org.apache.jasper.compiler.Compiler {
                 // 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 stable ECJ version.
+                // May be supported in a snapshot build.
+                // This is checked against the actual version below.
+                settings.put(CompilerOptions.OPTION_TargetPlatform, "18");
+                settings.put(CompilerOptions.OPTION_Compliance, "18");
             } else {
                 log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", 
opt));
                 settings.put(CompilerOptions.OPTION_TargetPlatform, 
CompilerOptions.VERSION_1_7);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 3b780da..2676b73 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -194,6 +194,13 @@
         <code>PropertyNotWritableException</code>s caused by a typo in the name
         used for a resource string. (markt)
       </fix>
+      <add>
+        Add support for specifying Java 18 (with the value <code>18</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="WebSocket">

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

Reply via email to