Preferring class files to source files in ClassReader.java

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Nov 13 15:00:20 PST 2013


On 11/13/2013 02:38 PM, Jeremy Manson wrote:
> Hi folks,
>
> A bit of background:
>
> - We use a content-addressable storage around here, so to minimize the 
> diffs between two JAR files (and get more hits in our 
> content-addressable storage), we reset all timestamps in JAR files to 
> the same values.
> - Some of our users include both source and class files in their JAR 
> files.
> - When those users want to put those JAR files on the classpath for 
> javac, and use them to compile other files, they may not have included 
> enough on the classpath to compile the source files.
> - We've worked around this by favoring classfiles when the two files 
> are of the same age.  This has the added benefit of not having to 
> recompile the source files when they are found.
> - What do you think?  Too esoteric?  Wait for JDK9?


Since you've gotten in the business of zapping timestamps in jar files 
anyway, why not zap them more intelligently so that class files have 
newer time stamps than corresponding source files?

-- Jon


More information about the compiler-dev mailing list