On 04/23/2015 07:51 AM, Staffan Larsen wrote:
Here is an improved and simplified patch:
diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
@@ -259,8 +259,7 @@
saProps = new Properties();
URL url = null;
try {
- url = VM.class.getClassLoader().getResource("sa.properties");
- saProps.load(new BufferedInputStream(url.openStream()));
+ saProps.load(VM.class.getResourceAsStream("/sa.properties"));
} catch (Exception e) {
System.err.println("Unable to load properties " +
(url == null ? "null" :
url.toString()) +
This is a better version. Looks good.
Mandy