You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/10/09 13:08:57 UTC

[tomcat] branch master updated (791ef21 -> 0aae9bd)

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

markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


    from 791ef21  Fix URI parsing with encodedSolidusHandling="passthrough"
     new 374690d  Fix BZ 64784. Don't include timestamp in .java file when pre-compiling
     new 0aae9bd  Found another place where the version needs to be updated

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/jasper/JspC.java                       | 13 +++++++++++++
 java/org/apache/jasper/Options.java                    | 12 ++++++++++++
 java/org/apache/jasper/compiler/Generator.java         |  6 ++++--
 java/org/apache/jasper/servlet/JspCServletContext.java |  2 +-
 webapps/docs/changelog.xml                             |  6 ++++++
 5 files changed, 36 insertions(+), 3 deletions(-)


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


[tomcat] 02/02: Found another place where the version needs to be updated

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0aae9bd17f5be1c4ca1de199f11a98e855b0389f
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Oct 9 14:08:36 2020 +0100

    Found another place where the version needs to be updated
---
 java/org/apache/jasper/servlet/JspCServletContext.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/jasper/servlet/JspCServletContext.java b/java/org/apache/jasper/servlet/JspCServletContext.java
index 9d6bf59..2727aed 100644
--- a/java/org/apache/jasper/servlet/JspCServletContext.java
+++ b/java/org/apache/jasper/servlet/JspCServletContext.java
@@ -495,7 +495,7 @@ public class JspCServletContext implements ServletContext {
      */
     @Override
     public String getServerInfo() {
-        return "JspC/ApacheTomcat9";
+        return "JspC/ApacheTomcat10";
     }
 
 


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


[tomcat] 01/02: Fix BZ 64784. Don't include timestamp in .java file when pre-compiling

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 374690d5793248f26d5894a33bb5ed562e22da91
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Oct 9 14:02:50 2020 +0100

    Fix BZ 64784. Don't include timestamp in .java file when pre-compiling
---
 java/org/apache/jasper/JspC.java               | 13 +++++++++++++
 java/org/apache/jasper/Options.java            | 12 ++++++++++++
 java/org/apache/jasper/compiler/Generator.java |  6 ++++--
 webapps/docs/changelog.xml                     |  6 ++++++
 4 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/jasper/JspC.java b/java/org/apache/jasper/JspC.java
index ff28ed1..3804d2a 100644
--- a/java/org/apache/jasper/JspC.java
+++ b/java/org/apache/jasper/JspC.java
@@ -1124,6 +1124,19 @@ public class JspC extends Task implements Options {
         return tagPluginManager;
     }
 
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Hard-coded to {@code false} for pre-compiled code to enable repeatable
+     * builds.
+     */
+    @Override
+    public boolean getGeneratedJavaAddTimestamp() {
+        return false;
+    }
+
+
     /**
      * Adds servlet declaration and mapping for the JSP page servlet to the
      * generated web.xml fragment.
diff --git a/java/org/apache/jasper/Options.java b/java/org/apache/jasper/Options.java
index 4b100aa..19f3947 100644
--- a/java/org/apache/jasper/Options.java
+++ b/java/org/apache/jasper/Options.java
@@ -360,4 +360,16 @@ public interface Options {
     public default boolean getUseInstanceManagerForTags() {
         return false;
     }
+
+
+    /**
+     * Should the container include the time the file was generated in the
+     * comments at the start of a Java file generated from a JSP or tag.
+     * Defaults to {@code true}.
+     *
+     * @return {@code true} to include the timestamp, otherwise don't include it
+     */
+    public default boolean getGeneratedJavaAddTimestamp() {
+        return true;
+    }
 }
diff --git a/java/org/apache/jasper/compiler/Generator.java b/java/org/apache/jasper/compiler/Generator.java
index bcd0412..21593d8 100644
--- a/java/org/apache/jasper/compiler/Generator.java
+++ b/java/org/apache/jasper/compiler/Generator.java
@@ -3669,8 +3669,10 @@ class Generator {
         out.println("/*");
         out.println(" * Generated by the Jasper component of Apache Tomcat");
         out.println(" * Version: " + ctxt.getServletContext().getServerInfo());
-        out.println(" * Generated at: " + timestampFormat.format(new Date()) +
-                " UTC");
+        if (ctxt.getOptions().getGeneratedJavaAddTimestamp()) {
+            out.println(" * Generated at: " + timestampFormat.format(new Date()) +
+                    " UTC");
+        }
         out.println(" * Note: The last modified time of this file was set to");
         out.println(" *       the last modified time of the source file after");
         out.println(" *       generation to assist with modification tracking.");
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 68859ce..691ec31 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -74,6 +74,12 @@
   <subsection name="Jasper">
     <changelog>
       <fix>
+        <bug>64784</bug>: Don't include the time the Java file was generated as
+        a comment when generating Java files for JSPs and/or tags if the Java
+        file was created during pre-compilation. This is to aid repeatable
+        builds. (markt)
+      </fix>
+      <fix>
         <bug>64794</bug>: Security exception reading system property on
         JspRuntimeLibrary use. (remm)
       </fix>


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