# HG changeset patch # User Doug Simon # Date 1378815908 -7200 # Node ID ae00dd0ff81e5f6a69aeb8ade0829f47b4b995a1 # Parent c106320fab79547f5548abba00d4c6b22cbfb161 made methods for accessing HotSpot VM options static so they can be used without a HotSpotVMConfig object diff -r c106320fab79 -r ae00dd0ff81e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Tue Sep 10 00:15:32 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Tue Sep 10 14:25:08 2013 +0200 @@ -38,7 +38,7 @@ private static final long serialVersionUID = -4744897993263044184L; - private final HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); + private static final HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); HotSpotVMConfig(CompilerToVM c2vm) { c2vm.initializeConfiguration(this); @@ -52,9 +52,9 @@ * @return value of option * @throws IllegalArgumentException if option doesn't exist */ - private int getVMOptionInt(String name) { + public static int getVMOptionInt(String name) { String value = diagnostic.getVMOption(name).getValue(); - return new Integer(value).intValue(); + return Integer.valueOf(value).intValue(); } /** @@ -64,7 +64,7 @@ * @param defaultValue default value if option is not exists (e.g. development options) * @return value of option or defaultValue if option doesn't exist */ - private int getVMOption(String name, int defaultValue) { + public static int getVMOption(String name, int defaultValue) { try { return getVMOptionInt(name); } catch (IllegalArgumentException e) { @@ -79,9 +79,9 @@ * @return value of option * @throws IllegalArgumentException if option doesn't exist */ - private boolean getVMOption(String name) { + public static boolean getVMOption(String name) { String value = diagnostic.getVMOption(name).getValue(); - return new Boolean(value).booleanValue(); + return Boolean.valueOf(value).booleanValue(); } /** @@ -91,7 +91,7 @@ * @param defaultValue default value if option is not exists (e.g. development options) * @return value of option or defaultValue if option doesn't exist */ - private boolean getVMOption(String name, boolean defaultValue) { + public static boolean getVMOption(String name, boolean defaultValue) { try { return getVMOption(name); } catch (IllegalArgumentException e) {