changeset 9730:6abbf8961dc6

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
author sebastian
date Thu, 10 Dec 2015 17:48:44 +0100
parents 1fd6f49c4b51
children 754cfdb6fa55
files agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Thu Dec 10 15:27:16 2015 +0100
+++ b/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;
         }