[8u] RFR: 8229888: (zipfs) Updating an existing zip file does not preserve original permissions

Alex Kashchenko akashche at redhat.com
Sat Apr 4 11:28:42 UTC 2020


On 04/02/2020 04:46 AM, Andrew Hughes wrote:
> On 26/03/2020 23:15, Alex Kashchenko wrote:
>> Hi,
>>
>> Please review the backport of JDK-8229888 to 8u:
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8229888
>>
>> Original review thread:
>> http://mail.openjdk.java.net/pipermail/nio-dev/2019-December/006894.html
>>
>> 11u changeset:
>> https://hg.openjdk.java.net/jdk-updates/jdk11u/rev/57fd597352b8
>>
>> 8u webrev: http://cr.openjdk.java.net/~akasko/jdk8u/8229888/webrev.00/
>>
>> 8u patch is very close to 11u one: ZipFileSystem part is the same, test
>> is changed to replace API not available in 8u, changes to policy file
>> are not included.
>>
> 
> It would be helpful if you could explain why such changes had to be
> made, rather than leaving the reviewer to guess.
> 
> The test changes are fairly clear, though the replacement for Set.of,
> createSet, returns a modifiable set, whereas of returns an unmodifiable
> set. This doesn't really matter for a test case, but may in JDK code.
> 
> It could also potentially be simplified to just:
> 
>      private static Set<Object> createSet(Object... entries) {
> 	Set<Object> set = new LinkedHashSet<>(Arrays.asList(entries));
> 	return Collections.unmodifiableSet(set);
>      }

Thanks for the review! I simplified this part of test removing 
createSet() helper:

https://cr.openjdk.java.net/~akasko/jdk8u/8229888/webrev.01/

> 
> I'm not sure why the policy file change is unnecessary. I would guess
> it's because the zipfs code is only demo code in 8u, but it would be
> good to have more reassurance.

AFAIU these changes to policy file are only necessary for jdk9+ with 
JPMS, some details on this policy change in jdk11:

https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-March/002644.html

https://mail.openjdk.java.net/pipermail/nio-dev/2019-March/005978.html


-- 
-Alex



More information about the jdk8u-dev mailing list