[jdk11u-dev] RFR: 8263940: NPE when creating default file system when default file system provider is packaged as JAR file on class path [v2]

Goetz Lindenmaier goetz at openjdk.org
Sun Apr 28 20:18:09 UTC 2024


On Sun, 28 Apr 2024 09:12:33 GMT, Amos Shi <ashi at openjdk.org> wrote:

>> Backport of [JDK-8263940](https://bugs.openjdk.org/browse/JDK-8263940)
>> - This PR contains 2 commits
>>   - commit 1 - is the changed from `git apply`
>>   - commit 2 - is the manual merge based on the `ZipFile.java.rej` and `SetDefaultProvider.java.rej` files
>>     - We respect all the changes of the `.rej` files, 
>>     - In `ZipFile.java` - Added missing parameter `ZipCoder zc` in `private static class Key`
>>     - In `SetDefaultProvider.java` - Fixed Java 11 compile errors
>> 
>> - `git apply` log
>> 
>> github.com/dev-8263940-11
>> branch 'backport-8263940' set up to track 'origin/backport-8263940'.
>> Switched to a new branch 'backport-8263940'
>> 
>> patching file 'src/java.base/share/classes/java/util/zip/ZipFile.java'
>> Reversed (or previously applied) patch detected!  Assume -R? [y] y
>> 2 out of 3 hunks failed--saving rejects to 'src/java.base/share/classes/java/util/zip/ZipFile.java.rej'
>> patching file 'test/jdk/java/nio/file/spi/SetDefaultProvider.java'
>> 1 out of 3 hunks failed--saving rejects to 'test/jdk/java/nio/file/spi/SetDefaultProvider.java.rej'
>> 
>> 
>> - `git status` log
>> 
>> 
>> modified:   src/java.base/share/classes/java/util/zip/ZipFile.java
>> modified:   test/jdk/java/nio/file/spi/SetDefaultProvider.java
>> 
>> Untracked files:
>>   src/java.base/share/classes/java/util/zip/ZipFile.java.rej
>>   test/jdk/java/nio/file/spi/SetDefaultProvider.java.rej
>> 
>> 
>> - `src/java.base/share/classes/java/util/zip/ZipFile.java.rej` content
>> 
>> 
>> @@ -68,7 +69,6 @@
>>  import jdk.internal.ref.CleanerFactory;
>>  import jdk.internal.vm.annotation.Stable;
>>  import sun.nio.cs.UTF_8;
>> -import sun.nio.fs.DefaultFileSystemProvider;
>>  import sun.security.util.SignatureFileVerifier;
>>  
>>  import static java.util.zip.ZipConstants64.*;
>> @@ -1255,19 +1255,14 @@
>>              }
>>          }
>>          private static final HashMap<Key, Source> files = new HashMap<>();
>> -        /**
>> -         * Use the platform's default file system to avoid
>> -         * issues when the VM is configured to use a custom file system provider.
>> -         */
>> -        private static final java.nio.file.FileSystem builtInFS =
>> -                DefaultFileSystemProvider.theFileSystem();
>> +
>>  
>>          static Source get(File file, boolean toDelete, ZipCoder zc) throws IOException {
>>              final Key key;
>>              try {
>>                  key = new Key(file,
>> -                        Files.readAttributes(builtInFS.getPath(file.getPath()),
>> -                      ...
>
> Amos Shi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8263940: Remove the un-necessary parameter zc

LGTM

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

Marked as reviewed by goetz (Reviewer).

PR Review: https://git.openjdk.org/jdk11u-dev/pull/2647#pullrequestreview-2027339624


More information about the jdk-updates-dev mailing list