[8u] RFR: 8061777: (zipfs) IllegalArgumentException in ZipCoder.toString when using Shitft_JIS

Andrew Hughes gnu.andrew at redhat.com
Wed Feb 17 04:00:12 UTC 2021


On 17:04 Tue 16 Feb     , Severin Gehwolf wrote:
> Hi,
> 
> Please review this zip fs fix. It's a fix Oracle did to their JDK 8
> too. The JDK 11u patch didn't apply cleanly and required some manual
> work. Mostly because:
> 
> a) The implementation of ZipFileSystem.getPath() is slightly
> different in 8u. It uses a local String variable 'path' over
> JDK 11's short return approach if more.length == 0. Either way,
> changes shoudl be equivalent.

I assume you mean JDK 9's, as that is where the patch is from.

The code was changed by JDK-8150496 as an optimisation:

https://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/b9ed1a4feefb#l3.82

8u version looks ok, as the fix is to perform normalisation
correctly in the ZipPath constructor, which requires the original
String object, not the result of getBytes (which is now called
in ZipPath's normalize methods)

> b) ZFSTests.java doesn't have JDK-8153248 changes which is not
> in OpenJDK 8u. Also context was different enough for hunks to
> not apply cleanly. I've ported them over manually.
>

Looks fine.

> Bug: https://bugs.openjdk.java.net/browse/JDK-8061777
> webrev: https://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8061777/01/webrev/
> 
> Testing: Added regression test (fails prior; passes after).
>  zipfs/java.util.zip tests.
> 
> Thoughts?
> 
> Thanks,
> Severin
> 
>  * 
> 

Please flag for approval.

Thanks,
-- 
Andrew :)

Senior Free Java Software Engineer
OpenJDK Package Owner
Red Hat, Inc. (http://www.redhat.com)

PGP Key: ed25519/0xCFDA0F9B35964222 (hkp://keys.gnupg.net)
Fingerprint = 5132 579D D154 0ED2 3E04  C5A0 CFDA 0F9B 3596 4222


More information about the jdk8u-dev mailing list