Bug 43006 - NPE if icon.properties file not found

git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-2@564889 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2007-08-11 10:14:57 +00:00
parent 7019d6801c
commit 8f3fd01535
2 changed files with 9 additions and 2 deletions

View File

@ -27,6 +27,7 @@ import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.net.URL;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.Iterator; import java.util.Iterator;
@ -188,11 +189,16 @@ public class JMeterUtils implements UnitTestManager {
p.load(is); p.load(is);
} catch (IOException e) { } catch (IOException e) {
try { try {
is = JMeterUtils.class.getClassLoader().getResource(file).openStream(); final URL resource = JMeterUtils.class.getClassLoader().getResource(file);
if (is == null) { if (resource == null) {
log.warn("Cannot find " + file); log.warn("Cannot find " + file);
return null; return null;
} }
is = resource.openStream();
if (is == null) {
log.warn("Cannot open " + file);
return null;
}
p.load(is); p.load(is);
} catch (IOException ex) { } catch (IOException ex) {
log.warn("Error reading " + file + " " + ex.toString()); log.warn("Error reading " + file + " " + ex.toString());

View File

@ -36,6 +36,7 @@
<li>Fixed errors when running non-GUI on a headless host</li> <li>Fixed errors when running non-GUI on a headless host</li>
<li>Bug 43054 - SSLManager causes stress tests to saturate and crash</li> <li>Bug 43054 - SSLManager causes stress tests to saturate and crash</li>
<li>Clarified HTTP Request Defaults usage of the port field</li> <li>Clarified HTTP Request Defaults usage of the port field</li>
<li>Bug 43006 - NPE if icon.properties file not found</li>
</ul> </ul>
<h3>Version 2.3RC3</h3> <h3>Version 2.3RC3</h3>