src/share/classes/java/lang/Integer.java

Print this page
rev 5431 : 6924259: Remove offset and count fields from java.lang.String
Summary: Removes the use of shared character array buffers by String along with the two fields needed to support the use of shared buffers.
Contributed-by: brian.doherty@oracle.com

@@ -379,11 +379,11 @@
         if (i == Integer.MIN_VALUE)
             return "-2147483648";
         int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i);
         char[] buf = new char[size];
         getChars(i, size, buf);
-        return new String(0, size, buf);
+        return new String(buf, true);
     }
 
     /**
      * Returns a string representation of the argument as an unsigned
      * decimal value.