Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1
-
None
-
None
-
Java 8 / Linux
Description
I expect that
URL url = Test.class.getResource( "/Test.xml"); XMLConfiguration config = new XMLConfiguration(); config.read( url.openStream());
Would read the XML file. However it will throw a NPE at line 967
private void load(InputSource source) throws ConfigurationException { try { URL sourceURL = locator.getSourceURL(); // <- NPE here if (sourceURL != null) { source.setSystemId(sourceURL.toString()); }
I believe that testing for locator == null first will solve the problem as the rest of the code in the method does not appear to use it.