< prev index next >

src/java.base/share/classes/java/lang/StringConcatHelper.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -215,20 +215,20 @@
                 buf[--index] = 'a';
                 buf[--index] = 'f';
             }
         } else {
             if (value) {
-                StringUTF16.putChar(buf, --index, 'e');
-                StringUTF16.putChar(buf, --index, 'u');
-                StringUTF16.putChar(buf, --index, 'r');
-                StringUTF16.putChar(buf, --index, 't');
+                StringUTF16.Trusted.putChar(buf, --index, 'e');
+                StringUTF16.Trusted.putChar(buf, --index, 'u');
+                StringUTF16.Trusted.putChar(buf, --index, 'r');
+                StringUTF16.Trusted.putChar(buf, --index, 't');
             } else {
-                StringUTF16.putChar(buf, --index, 'e');
-                StringUTF16.putChar(buf, --index, 's');
-                StringUTF16.putChar(buf, --index, 'l');
-                StringUTF16.putChar(buf, --index, 'a');
-                StringUTF16.putChar(buf, --index, 'f');
+                StringUTF16.Trusted.putChar(buf, --index, 'e');
+                StringUTF16.Trusted.putChar(buf, --index, 's');
+                StringUTF16.Trusted.putChar(buf, --index, 'l');
+                StringUTF16.Trusted.putChar(buf, --index, 'a');
+                StringUTF16.Trusted.putChar(buf, --index, 'f');
             }
         }
         return index;
     }
 

@@ -258,11 +258,11 @@
      */
     static int prepend(int index, byte[] buf, byte coder, char value) {
         if (coder == String.LATIN1) {
             buf[--index] = (byte) (value & 0xFF);
         } else {
-            StringUTF16.putChar(buf, --index, value);
+            StringUTF16.Trusted.putChar(buf, --index, value);
         }
         return index;
     }
 
     /**

@@ -291,11 +291,11 @@
      */
     static int prepend(int index, byte[] buf, byte coder, int value) {
         if (coder == String.LATIN1) {
             return Integer.getChars(value, index, buf);
         } else {
-            return Integer.getCharsUTF16(value, index, buf);
+            return StringUTF16.Trusted.getChars(value, index, buf);
         }
     }
 
     /**
      * Prepends the stringly representation of long value into buffer,

@@ -309,11 +309,11 @@
      */
     static int prepend(int index, byte[] buf, byte coder, long value) {
         if (coder == String.LATIN1) {
             return Long.getChars(value, index, buf);
         } else {
-            return Long.getCharsUTF16(value, index, buf);
+            return StringUTF16.Trusted.getChars(value, index, buf);
         }
     }
 
     /**
      * Prepends the stringly representation of String value into buffer,
< prev index next >