FULL PRODUCT VERSION :
ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.9.2
A DESCRIPTION OF THE PROBLEM :
I'm calling Class.getResourceAsStream("/directory/") where I'm running from a jar file contains a non-empty directory named /directory.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create an application that runs from a jar file containing a directory named /directory/. Call Class.getResourceAsStream("/directory/") and close the returned stream.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
It doesn't make sense to get an InputStream for a directory. This method should return null.
ACTUAL -
The method returns a non-null InputStream. But calling operations on that InputStream (like close()) throws a NullPointerException.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Catch the NullPointerException!
ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.9.2
A DESCRIPTION OF THE PROBLEM :
I'm calling Class.getResourceAsStream("/directory/") where I'm running from a jar file contains a non-empty directory named /directory.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create an application that runs from a jar file containing a directory named /directory/. Call Class.getResourceAsStream("/directory/") and close the returned stream.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
It doesn't make sense to get an InputStream for a directory. This method should return null.
ACTUAL -
The method returns a non-null InputStream. But calling operations on that InputStream (like close()) throws a NullPointerException.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Catch the NullPointerException!
Class.getResourceAsStream("/directory/") returns broken InputStream
FULL PRODUCT VERSION :
ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.9.2
A DESCRIPTION OF THE PROBLEM :
I'm calling Class.getResourceAsStream("/directory/") where I'm running from a jar file contains a non-empty directory named /directory.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create an application that runs from a jar file containing a directory named /directory/. Call Class.getResourceAsStream("/directory/") and close the returned stream.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
It doesn't make sense to get an InputStream for a directory. This method should return null.
ACTUAL -
The method returns a non-null InputStream. But calling operations on that InputStream (like close()) throws a NullPointerException.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Catch the NullPointerException!
ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.9.2
A DESCRIPTION OF THE PROBLEM :
I'm calling Class.getResourceAsStream("/directory/") where I'm running from a jar file contains a non-empty directory named /directory.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create an application that runs from a jar file containing a directory named /directory/. Call Class.getResourceAsStream("/directory/") and close the returned stream.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
It doesn't make sense to get an InputStream for a directory. This method should return null.
ACTUAL -
The method returns a non-null InputStream. But calling operations on that InputStream (like close()) throws a NullPointerException.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Catch the NullPointerException!