RFR: 8276766: Enable jar and jmod to produce deterministic timestamped content [v4]

Sean Coffey coffeys at openjdk.java.net
Fri Nov 26 12:27:07 UTC 2021


On Wed, 24 Nov 2021 16:56:35 GMT, Lance Andersen <lancea at openjdk.org> wrote:

>> Andrew Leonard has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
>> 
>>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>>    
>>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>>    
>>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>>    
>>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>>    
>>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>>  - 8276766: Enable jar and jmod to produce deterministic timestamped content
>>    
>>    Signed-off-by: Andrew Leonard <anleonar at redhat.com>
>
> src/jdk.jartool/share/classes/sun/tools/jar/Main.java line 2290:
> 
>> 2288:     private void setSourceDate(ZipEntry e, long origTime) {
>> 2289:         if (sourceDate != -1) {
>> 2290:           e.setTimeLocal(LocalDateTime.ofEpochSecond(sourceDate, 0, ZoneOffset.UTC));
> 
> The above could potentially throw a DateTimeException which may be OK but I would sanity check there are no issues

For files with large number of entries, alot of LocalDateTime Objects are being created here. Would there be an efficiency gain by converting sourceDate variable to be of type LocalDateTime and simply pass it to the s.setTimeLocal call here. The LocalDateTime Object could be constructed at init time (may be null) and can be static etc. 

Same for jmod code ?

-------------

PR: https://git.openjdk.java.net/jdk/pull/6481


More information about the compiler-dev mailing list