Re: RFR JDK-8149769: Null pointer exception in ZipFileSystemProvider

2016-02-12 Thread Steve Drach
> What's the issue? The bug description only includes the fix. If the env is 
> null, shouldn't
> it trigger a NPE?
> 
> The java.nio.file.spi package does have the note that "NPE, unless otherwise 
> noted ..."
> The api for FilesystemProvider.newFileSystem(..., env) says "env" can be 
> empty, means
> NPE for "null".
> 
> Maybe I miss something here?

No, you are not missing anything, I was.  I see ZipFileSystem will throw the 
NPE instead of ZipFileSystemProvider if my “fix” goes in, so it’ll still 
happen.  I rescind my request and will close the bug report with appropriate 
comment.


> 
> -Sherman
> 
> On 2/12/16 1:11 PM, Steve Drach wrote:
>> Hi,
>> 
>> Please review this simple fix to ZipFileSystemProvider.  The issue is 
>> JDK-8149769 .  I didn’t do 
>> a webrev but instead provide the following patch.
>> 
>> Thanks
>> Steve
>> 
>> diff -r 2d6c2c75f338 
>> src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java
>> --- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java   
>> Tue Feb 09 14:07:28 2016 -0800
>> +++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java   
>> Fri Feb 12 12:59:46 2016 -0800
>> @@ -100,7 +100,7 @@
>>  }
>>  ZipFileSystem zipfs = null;
>>  try {
>> -if (env.containsKey("multi-release")) {
>> +if (env != null && env.containsKey("multi-release")) {
>>  zipfs = new JarFileSystem(this, path, env);
>>  } else {
>>  zipfs = new ZipFileSystem(this, path, env);
> 



Re: RFR JDK-8149769: Null pointer exception in ZipFileSystemProvider

2016-02-12 Thread Xueming Shen

Steve,

What's the issue? The bug description only includes the fix. If the env 
is null, shouldn't

it trigger a NPE?

The java.nio.file.spi package does have the note that "NPE, unless 
otherwise noted ..."
The api for FilesystemProvider.newFileSystem(..., env) says "env" can be 
empty, means

NPE for "null".

Maybe I miss something here?

-Sherman

On 2/12/16 1:11 PM, Steve Drach wrote:

Hi,

Please review this simple fix to ZipFileSystemProvider.  The issue is JDK-8149769 
.  I didn’t do a webrev but 
instead provide the following patch.

Thanks
Steve

diff -r 2d6c2c75f338 
src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java  
Tue Feb 09 14:07:28 2016 -0800
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java  
Fri Feb 12 12:59:46 2016 -0800
@@ -100,7 +100,7 @@
  }
  ZipFileSystem zipfs = null;
  try {
-if (env.containsKey("multi-release")) {
+if (env != null && env.containsKey("multi-release")) {
  zipfs = new JarFileSystem(this, path, env);
  } else {
  zipfs = new ZipFileSystem(this, path, env);




Re: RFR JDK-8149769: Null pointer exception in ZipFileSystemProvider

2016-02-12 Thread Steve Drach
>> Please review this simple fix to ZipFileSystemProvider.  The issue is 
>> JDK-8149769 .  I didn’t do 
>> a webrev but instead provide the following patch.
>> 
>> 
> This looks okay. Can one of the existing tests be updated to cover this case?

Yes, almost any of them can be updated.  There is one, ZipFSTester.java that 
seems to be associated with a lot of bugs, so maybe that one.  Or I can put it 
in MultiReleaseJarTest, which makes sense because the code it tests was the 
code that caused the bug.  Any preferences?

Re: RFR JDK-8149769: Null pointer exception in ZipFileSystemProvider

2016-02-12 Thread Alan Bateman



On 12/02/2016 21:11, Steve Drach wrote:

Hi,

Please review this simple fix to ZipFileSystemProvider.  The issue is JDK-8149769 
.  I didn’t do a webrev but 
instead provide the following patch.


This looks okay. Can one of the existing tests be updated to cover this 
case?


-Alan


Re: RFR JDK-8149769: Null pointer exception in ZipFileSystemProvider

2016-02-12 Thread Roger Riggs

Look fine.

Roger


On 2/12/16 4:11 PM, Steve Drach wrote:

Hi,

Please review this simple fix to ZipFileSystemProvider.  The issue is JDK-8149769 
.  I didn’t do a webrev but 
instead provide the following patch.

Thanks
Steve

diff -r 2d6c2c75f338 
src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java  
Tue Feb 09 14:07:28 2016 -0800
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java  
Fri Feb 12 12:59:46 2016 -0800
@@ -100,7 +100,7 @@
  }
  ZipFileSystem zipfs = null;
  try {
-if (env.containsKey("multi-release")) {
+if (env != null && env.containsKey("multi-release")) {
  zipfs = new JarFileSystem(this, path, env);
  } else {
  zipfs = new ZipFileSystem(this, path, env);




RFR JDK-8149769: Null pointer exception in ZipFileSystemProvider

2016-02-12 Thread Steve Drach
Hi,

Please review this simple fix to ZipFileSystemProvider.  The issue is 
JDK-8149769 .  I didn’t do a 
webrev but instead provide the following patch.

Thanks
Steve

diff -r 2d6c2c75f338 
src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java
--- a/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java  
Tue Feb 09 14:07:28 2016 -0800
+++ b/src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileSystemProvider.java  
Fri Feb 12 12:59:46 2016 -0800
@@ -100,7 +100,7 @@
 }
 ZipFileSystem zipfs = null;
 try {
-if (env.containsKey("multi-release")) {
+if (env != null && env.containsKey("multi-release")) {
 zipfs = new JarFileSystem(this, path, env);
 } else {
 zipfs = new ZipFileSystem(this, path, env);