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
The following commit(s) were added to refs/heads/10.1.x by this push:
new 31e40f7595 Add Java 24 support
31e40f7595 is described below
commit 31e40f7595f4b34bef635d742dc160ef7335e31d
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jun 26 14:40:29 2024 +0100
Add Java 24 support
---
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 6720413810..4f8926bb37 100644
--- a/java/org/apache/jasper/compiler/JDTCompiler.java
+++ b/java/org/apache/jasper/compiler/JDTCompiler.java
@@ -334,6 +334,11 @@ public class JDTCompiler extends
org.apache.jasper.compiler.Compiler {
// Java 11.
// This is checked against the actual version below.
settings.put(CompilerOptions.OPTION_Source, "23");
+ } else if (opt.equals("24")) {
+ // 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, "24");
} else {
log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM",
opt));
settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_11);
@@ -425,6 +430,12 @@ public class JDTCompiler extends
org.apache.jasper.compiler.Compiler {
// This is checked against the actual version below.
settings.put(CompilerOptions.OPTION_TargetPlatform, "23");
settings.put(CompilerOptions.OPTION_Compliance, "23");
+ } else if (opt.equals("24")) {
+ // 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, "24");
+ settings.put(CompilerOptions.OPTION_Compliance, "24");
} 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 44ca78525d..3970fbd116 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -158,6 +158,13 @@
<code>ELException</code> when an object is coerced to a String using
<code>ExpressionFactory.coerceToType()</code>. (markt)
</fix>
+ <add>
+ Add support for specifying Java 24 (with the value <code>24</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="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]