RFR: 8078519 Can't run SA tools from a non-images build

Alan Bateman Alan.Bateman at oracle.com
Thu Apr 23 15:12:05 UTC 2015



On 23/04/2015 15:51, 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 looks good to me.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20150423/9f0dce5f/attachment.html>


More information about the serviceability-dev mailing list