changeset 52156:1801fada294a

8197881: Better StringBuilder support Reviewed-by: rriggs
author sherman
date Wed, 28 Mar 2018 08:42:45 -0700
parents c31b6e1c4383
children 7593b9b8e8f2
files src/java.base/share/classes/java/lang/AbstractStringBuilder.java
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/lang/AbstractStringBuilder.java	Thu Mar 08 14:04:39 2018 +0800
+++ b/src/java.base/share/classes/java/lang/AbstractStringBuilder.java	Wed Mar 28 08:42:45 2018 -0700
@@ -69,10 +69,13 @@
      */
     int count;
 
+    private static final byte[] EMPTYVALUE = new byte[0];
+
     /**
      * This no-arg constructor is necessary for serialization of subclasses.
      */
     AbstractStringBuilder() {
+        value = EMPTYVALUE;
     }
 
     /**