[9] RFR of 8073187: Unexpected side effect in Pack200

mikhail cherkasov mikhail.cherkasov at oracle.com
Fri Feb 20 07:19:14 UTC 2015


Sorry, I sent link to the old webrev, this is correct one:

http://cr.openjdk.java.net/~mcherkas/8073187/webrev.01/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java.udiff.html

On 2/20/2015 9:58 AM, mikhail cherkasov wrote:
> Hi all,
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8073187
>
> The problem is that packer changes global state( default time zone ) 
> without proper synchronization:
> http://hg.openjdk.java.net/jdk9/client/jdk/file/a159e5358e25/src/java.base/share/classes/com/sun/java/util/jar/pack/PackerImpl.java#l85 
>
>
> however javadoc says that it's save to use it in concurrent way if 
> each thread has it's own packer instance:
> http://hg.openjdk.java.net/jdk9/client/jdk/file/a159e5358e25/src/java.base/share/classes/java/util/jar/Pack200.java#l149 
>
>
> The fix isn't perfect but it the only possible solution:
> 1. first packer saves default time zone
> 2. the last set it back.
>
> Webrev:
> http://cr.openjdk.java.net/~mcherkas/8073187/webrev/src/share/classes/com/sun/java/util/jar/pack/PackerImpl.java.udiff.html 
>
>
> Thanks,
> Mikhail.
>
>




More information about the core-libs-dev mailing list