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 e5e3beb149 Add support for Java 19 JSP compilation (if JDT supports it) e5e3beb149 is described below commit e5e3beb149ac31ab4189bdcfade4d32901ea3dd1 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 | 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 1afc4dcadb..4dacf9eb8c 100644 --- a/java/org/apache/jasper/compiler/JDTCompiler.java +++ b/java/org/apache/jasper/compiler/JDTCompiler.java @@ -371,6 +371,11 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { // 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_7); @@ -462,6 +467,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_7); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index cad8313c6d..c7b1dd71fd 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -165,6 +165,13 @@ Update <code>ImportHandler</code> optimisation for new classes introduced in Java 19. (markt) </fix> + <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> <subsection name="Web applications"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org