RFR: 8078519 Can't run SA tools from a non-images build
Mandy Chung
mandy.chung at oracle.com
Thu Apr 23 16:41:37 UTC 2015
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20150423/5f9c61ea/attachment.html>
More information about the serviceability-dev
mailing list