8145061: Too many instances of java.lang.Boolean created in Java application (hotspot repo)
authorsebastian
Thu, 10 Dec 2015 17:48:44 +0100
changeset 35064 f1770c7f39bf
parent 35063 cb24277be2e7
child 35066 cd4ac076bf7f
8145061: Too many instances of java.lang.Boolean created in Java application (hotspot repo) Summary: Avoid creating unused instances of Long and Boolean Reviewed-by: dholmes, sla
hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Thu Dec 10 15:27:16 2015 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Thu Dec 10 17:48:44 2015 +0100
@@ -229,17 +229,17 @@
 
      public String getValue() {
         if (isBool()) {
-           return new Boolean(getBool()).toString();
+           return Boolean.toString(getBool());
         } else if (isInt()) {
-           return new Long(getInt()).toString();
+           return Long.toString(getInt());
         } else if (isUInt()) {
-           return new Long(getUInt()).toString();
+           return Long.toString(getUInt());
         } else if (isIntx()) {
-           return new Long(getIntx()).toString();
+           return Long.toString(getIntx());
         } else if (isUIntx()) {
-           return new Long(getUIntx()).toString();
+           return Long.toString(getUIntx());
         } else if (isSizet()) {
-            return new Long(getSizet()).toString();
+            return Long.toString(getSizet());
         } else {
            return null;
         }