< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2015, 2016, 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. --- 1,7 ---- /* ! * 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,234 **** 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'); } 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'); } } return index; } --- 215,234 ---- buf[--index] = 'a'; buf[--index] = 'f'; } } else { if (value) { ! 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.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,268 **** */ 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); } return index; } /** --- 258,268 ---- */ static int prepend(int index, byte[] buf, byte coder, char value) { if (coder == String.LATIN1) { buf[--index] = (byte) (value & 0xFF); } else { ! StringUTF16.Trusted.putChar(buf, --index, value); } return index; } /**
*** 291,301 **** */ 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); } } /** * Prepends the stringly representation of long value into buffer, --- 291,301 ---- */ static int prepend(int index, byte[] buf, byte coder, int value) { if (coder == String.LATIN1) { return Integer.getChars(value, index, buf); } else { ! return StringUTF16.Trusted.getChars(value, index, buf); } } /** * Prepends the stringly representation of long value into buffer,
*** 309,319 **** */ 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); } } /** * Prepends the stringly representation of String value into buffer, --- 309,319 ---- */ static int prepend(int index, byte[] buf, byte coder, long value) { if (coder == String.LATIN1) { return Long.getChars(value, index, buf); } else { ! return StringUTF16.Trusted.getChars(value, index, buf); } } /** * Prepends the stringly representation of String value into buffer,
< prev index next >