Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.6
-
None
-
None
-
Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\Java\apache-maven-3.0.4\bin\..
Java version: 1.6.0_35, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_35\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500) Maven home: C:\Java\apache-maven-3.0.4\bin\.. Java version: 1.6.0_35, vendor: Sun Microsystems Inc. Java home: C:\Program Files\Java\jdk1.6.0_35\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
-
Unknown
Description
I am seeing an NPE that comes up randomly at org.apache.cxf.resource.ExtendedURIResolver.close(ExtendedURIResolver.java:75).
I see the method as:
public void close() { while (!resourceOpened.isEmpty()) { try { InputStream in = resourceOpened.pop(); in.close(); } catch (IOException ioe) { // move on... } } }
The NPE is on the line for "in.close();".
I have no way of reproducing this, I can just watch our builds fail on rare occasion and our tests do not log the full stack trace.
Since the catch clause does nothing, would it make sense to guard the close call? Like this:
public void close() { while (!resourceOpened.isEmpty()) { try { InputStream in = resourceOpened.pop(); if (in != null) { in.close(); } } catch (IOException ioe) { // move on... } } }