This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit e02be5c7d5438ee63f66bc0614875f732f25c4df Author: Mark Thomas <ma...@apache.org> AuthorDate: Tue Feb 27 08:55:13 2024 +0000 Add support for JSP compilation using Java 22 --- java/org/apache/jasper/compiler/JDTCompiler.java | 27 +++++++++++++++++------- webapps/docs/changelog.xml | 11 ++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java index 2a19f14794..283738d319 100644 --- a/java/org/apache/jasper/compiler/JDTCompiler.java +++ b/java/org/apache/jasper/compiler/JDTCompiler.java @@ -318,15 +318,20 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { } else if (opt.equals("19")) { settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_19); } else if (opt.equals("20")) { - // Constant not available in latest ECJ version shipped with - // Tomcat. May be supported in a snapshot build. + // Constant not available in ECJ version shipped with + // Tomcat. May be supported in a later or snapshot build. // This is checked against the actual version below. settings.put(CompilerOptions.OPTION_Source, "20"); } else if (opt.equals("21")) { - // Constant not available in latest ECJ version shipped with - // Tomcat. May be supported in a snapshot build. + // Constant not available in ECJ version shipped with + // Tomcat. May be supported in a later or snapshot build. // This is checked against the actual version below. settings.put(CompilerOptions.OPTION_Source, "21"); + } else if (opt.equals("22")) { + // Constant not available in ECJ version shipped with + // Tomcat. May be supported in a later or snapshot build. + // This is checked against the actual version below. + settings.put(CompilerOptions.OPTION_Source, "22"); } else { log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", opt)); settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); @@ -395,17 +400,23 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_19); settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_19); } else if (opt.equals("20")) { - // Constant not available in latest ECJ version shipped with - // Tomcat. May be supported in a snapshot build. + // Constant not available in ECJ version shipped with + // Tomcat. May be supported in a later or snapshot build. // This is checked against the actual version below. settings.put(CompilerOptions.OPTION_TargetPlatform, "20"); settings.put(CompilerOptions.OPTION_Compliance, "20"); } else if (opt.equals("21")) { - // Constant not available in latest ECJ version shipped with - // Tomcat. May be supported in a snapshot build. + // Constant not available in ECJ version shipped with + // Tomcat. May be supported in a later or snapshot build. // This is checked against the actual version below. settings.put(CompilerOptions.OPTION_TargetPlatform, "21"); settings.put(CompilerOptions.OPTION_Compliance, "21"); + } else if (opt.equals("22")) { + // Constant not available in ECJ version shipped with + // Tomcat. May be supported in a later or snapshot build. + // This is checked against the actual version below. + settings.put(CompilerOptions.OPTION_TargetPlatform, "22"); + settings.put(CompilerOptions.OPTION_Compliance, "22"); } else { log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", opt)); settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 3cc6d582fe..d9e39d5d32 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 10.1.20 (schultz)" rtext="in development"> + <subsection name="Jasper"> + <changelog> + <add> + Add support for specifying Java 21 (with the value <code>21</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="Cluster"> <changelog> <fix> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org