Bug 64784 - Add option to remove date from generated Java header comment
Summary: Add option to remove date from generated Java header comment
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 10
Classification: Unclassified
Component: Jasper (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ------
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-02 08:57 UTC by niklas
Modified: 2020-10-09 13:20 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description niklas 2020-10-02 08:57:20 UTC
Currently, org.apache.jasper.compiler.Generator#generateCommentHeader writes the current timestamp using `new Date()` into the comment header, which makes builds keeping sources non-reproducible, because the timestamp changes with each precompile.

There should be an option to disable or override this timestamp or maybe it can be removed completely?
Comment 1 Michael Osipov 2020-10-02 10:58:27 UTC
I would favor to remove it completely. It adds zero benefit.
Comment 2 Mark Thomas 2020-10-02 11:32:48 UTC
The date was added to the .java file to aid trouble shooting JSP compilation issues and remind system admins that the last modified time of the file will reflect the last modified time of the JSP source rather than the time the file was generated.

As far as I recall this wasn't requested by users but was something we added proactively when we started changing the last modified time although it would be worth a trawl through the archives to confirm my recollection.

I'm not against removing it entirely. I've done a fair amount of debugging of JSP generation and I don't recall using it. If we wanted to be cautious we could probably remove it when precompiling but leave it when compiling on demand.
Comment 3 Christopher Schultz 2020-10-02 14:45:26 UTC
+1 to at least removing it from a precompile.
Comment 4 Mark Thomas 2020-10-09 13:20:00 UTC
Fixed in:
- 10.0.x for 10.0.0-M10 onwards
- 9.0.x for 9.0.40 onwards

Disabled for pre-compiled files. Retained for on-the-fly compilation.