This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new 45f641f Make Java 11 the default source and target for JSPs 45f641f is described below commit 45f641f50a4866a0218e0052808273c626707182 Author: Mark Thomas <ma...@apache.org> AuthorDate: Sun Jan 2 16:28:11 2022 +0000 Make Java 11 the default source and target for JSPs --- conf/web.xml | 4 ++-- java/org/apache/jasper/EmbeddedServletOptions.java | 4 ++-- java/org/apache/jasper/JspC.java | 4 ++-- java/org/apache/jasper/compiler/JDTCompiler.java | 14 +++++++------- webapps/docs/changelog.xml | 5 +++++ webapps/docs/jasper-howto.xml | 4 ++-- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/conf/web.xml b/conf/web.xml index cbdd6fe..cc53db7 100644 --- a/conf/web.xml +++ b/conf/web.xml @@ -153,9 +153,9 @@ <!-- pages. See the jasper documentation for more --> <!-- information. --> <!-- --> - <!-- compilerSourceVM Compiler source VM. [1.8] --> + <!-- compilerSourceVM Compiler source VM. [11] --> <!-- --> - <!-- compilerTargetVM Compiler target VM. [1.8] --> + <!-- compilerTargetVM Compiler target VM. [11] --> <!-- --> <!-- development Is Jasper used in development mode? If true, --> <!-- the frequency at which JSPs are checked for --> diff --git a/java/org/apache/jasper/EmbeddedServletOptions.java b/java/org/apache/jasper/EmbeddedServletOptions.java index 7a4c8db..23a59aa 100644 --- a/java/org/apache/jasper/EmbeddedServletOptions.java +++ b/java/org/apache/jasper/EmbeddedServletOptions.java @@ -131,12 +131,12 @@ public final class EmbeddedServletOptions implements Options { /** * Compiler target VM. */ - private String compilerTargetVM = "1.8"; + private String compilerTargetVM = "11"; /** * The compiler source VM. */ - private String compilerSourceVM = "1.8"; + private String compilerSourceVM = "11"; /** * The compiler class name. diff --git a/java/org/apache/jasper/JspC.java b/java/org/apache/jasper/JspC.java index ca6f8fb..3bf6f80 100644 --- a/java/org/apache/jasper/JspC.java +++ b/java/org/apache/jasper/JspC.java @@ -201,8 +201,8 @@ public class JspC extends Task implements Options { protected String compiler = null; - protected String compilerTargetVM = "1.8"; - protected String compilerSourceVM = "1.8"; + protected String compilerTargetVM = "11"; + protected String compilerSourceVM = "11"; protected boolean classDebugInfo = true; diff --git a/java/org/apache/jasper/compiler/JDTCompiler.java b/java/org/apache/jasper/compiler/JDTCompiler.java index 69c6e05..0a3528d 100644 --- a/java/org/apache/jasper/compiler/JDTCompiler.java +++ b/java/org/apache/jasper/compiler/JDTCompiler.java @@ -320,11 +320,11 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { settings.put(CompilerOptions.OPTION_Source, "18"); } else { log.warn(Localizer.getMessage("jsp.warning.unknown.sourceVM", opt)); - settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8); + settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); } } else { - // Default to 1.8 - settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_8); + // Default to 11 + settings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_11); } // Target JVM @@ -387,12 +387,12 @@ public class JDTCompiler extends org.apache.jasper.compiler.Compiler { settings.put(CompilerOptions.OPTION_Compliance, "18"); } else { log.warn(Localizer.getMessage("jsp.warning.unknown.targetVM", opt)); - settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8); + settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); } } else { - // Default to 1.8 - settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_8); - settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_1_8); + // Default to 11 + settings.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_11); + settings.put(CompilerOptions.OPTION_Compliance, CompilerOptions.VERSION_11); } final IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault()); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 53a1f3b..d3a0347 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -153,6 +153,11 @@ a warning will be logged and the default will used. (markt) </add> + <update> + To align with the JSP 3.1 specification that requires Java 11 as a + minimum, make the default JSP source version and target version Java 11. + (markt) + </update> </changelog> </subsection> <subsection name="WebSocket"> diff --git a/webapps/docs/jasper-howto.xml b/webapps/docs/jasper-howto.xml index 782a30a..255b69a 100644 --- a/webapps/docs/jasper-howto.xml +++ b/webapps/docs/jasper-howto.xml @@ -106,10 +106,10 @@ set then <code>setenv.[sh|bat]</code> should be used to add to the <code>CLASSPATH</code> environment variable.</li> <li><strong>compilerSourceVM</strong> - What JDK version are the source files -compatible with? (Default value: <code>1.8</code>)</li> +compatible with? (Default value: <code>11</code>)</li> <li><strong>compilerTargetVM</strong> - What JDK version are the generated files -compatible with? (Default value: <code>1.8</code>)</li> +compatible with? (Default value: <code>11</code>)</li> <li><strong>development</strong> - Is Jasper used in development mode? If true, the frequency at which JSPs are checked for modification may be specified via --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org