--- old/src/java.base/share/classes/java/lang/String.java 2018-09-28 11:28:37.425908797 +0700
+++ new/src/java.base/share/classes/java/lang/String.java 2018-09-28 11:28:37.001908797 +0700
@@ -250,7 +250,7 @@
* @param value
* The initial value of the string
*/
- public String(char value[]) {
+ public String(char[] value) {
this(value, 0, value.length, null);
}
@@ -275,7 +275,7 @@
* If {@code offset} is negative, {@code count} is negative, or
* {@code offset} is greater than {@code value.length - count}
*/
- public String(char value[], int offset, int count) {
+ public String(char[] value, int offset, int count) {
this(value, offset, count, rangeCheck(value, offset, count));
}
@@ -372,7 +372,7 @@
* @see #String(byte[])
*/
@Deprecated(since="1.1")
- public String(byte ascii[], int hibyte, int offset, int count) {
+ public String(byte[] ascii, int hibyte, int offset, int count) {
checkBoundsOffCount(offset, count, ascii.length);
if (count == 0) {
this.value = "".value;
@@ -424,7 +424,7 @@
* @see #String(byte[])
*/
@Deprecated(since="1.1")
- public String(byte ascii[], int hibyte) {
+ public String(byte[] ascii, int hibyte) {
this(ascii, hibyte, 0, ascii.length);
}
@@ -461,7 +461,7 @@
*
* @since 1.1
*/
- public String(byte bytes[], int offset, int length, String charsetName)
+ public String(byte[] bytes, int offset, int length, String charsetName)
throws UnsupportedEncodingException {
if (charsetName == null)
throw new NullPointerException("charsetName");
@@ -502,7 +502,7 @@
*
* @since 1.6
*/
- public String(byte bytes[], int offset, int length, Charset charset) {
+ public String(byte[] bytes, int offset, int length, Charset charset) {
if (charset == null)
throw new NullPointerException("charset");
checkBoundsOffCount(offset, length, bytes.length);
@@ -535,7 +535,7 @@
*
* @since 1.1
*/
- public String(byte bytes[], String charsetName)
+ public String(byte[] bytes, String charsetName)
throws UnsupportedEncodingException {
this(bytes, 0, bytes.length, charsetName);
}
@@ -560,7 +560,7 @@
*
* @since 1.6
*/
- public String(byte bytes[], Charset charset) {
+ public String(byte[] bytes, Charset charset) {
this(bytes, 0, bytes.length, charset);
}
@@ -590,7 +590,7 @@
*
* @since 1.1
*/
- public String(byte bytes[], int offset, int length) {
+ public String(byte[] bytes, int offset, int length) {
checkBoundsOffCount(offset, length, bytes.length);
StringCoding.Result ret = StringCoding.decode(bytes, offset, length);
this.value = ret.value;
@@ -853,7 +853,7 @@
*
{@code dstBegin+(srcEnd-srcBegin)} is larger than
* {@code dst.length}
*/
- public void getChars(int srcBegin, int srcEnd, char dst[], int dstBegin) {
+ public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) {
checkBoundsBeginEnd(srcBegin, srcEnd, length());
checkBoundsOffCount(dstBegin, srcEnd - srcBegin, dst.length);
if (isLatin1()) {
@@ -907,7 +907,7 @@
*
*/
@Deprecated(since="1.1")
- public void getBytes(int srcBegin, int srcEnd, byte dst[], int dstBegin) {
+ public void getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin) {
checkBoundsBeginEnd(srcBegin, srcEnd, length());
Objects.requireNonNull(dst);
checkBoundsOffCount(dstBegin, srcEnd - srcBegin, dst.length);
@@ -1043,8 +1043,8 @@
if (len != sb.length()) {
return false;
}
- byte v1[] = value;
- byte v2[] = sb.getValue();
+ byte[] v1 = value;
+ byte[] v2 = sb.getValue();
if (coder() == sb.getCoder()) {
int n = v1.length;
for (int i = 0; i < n; i++) {
@@ -1195,8 +1195,8 @@
* lexicographically greater than the string argument.
*/
public int compareTo(String anotherString) {
- byte v1[] = value;
- byte v2[] = anotherString.value;
+ byte[] v1 = value;
+ byte[] v2 = anotherString.value;
if (coder() == anotherString.coder()) {
return isLatin1() ? StringLatin1.compareTo(v1, v2)
: StringUTF16.compareTo(v1, v2);
@@ -1224,8 +1224,8 @@
private static final long serialVersionUID = 8575799808933029326L;
public int compare(String s1, String s2) {
- byte v1[] = s1.value;
- byte v2[] = s2.value;
+ byte[] v1 = s1.value;
+ byte[] v2 = s2.value;
if (s1.coder() == s2.coder()) {
return s1.isLatin1() ? StringLatin1.compareToCI(v1, v2)
: StringUTF16.compareToCI(v1, v2);
@@ -1297,8 +1297,8 @@
* {@code false} otherwise.
*/
public boolean regionMatches(int toffset, String other, int ooffset, int len) {
- byte tv[] = value;
- byte ov[] = other.value;
+ byte[] tv = value;
+ byte[] ov = other.value;
// Note: toffset, ooffset, or len might be near -1>>>1.
if ((ooffset < 0) || (toffset < 0) ||
(toffset > (long)length() - len) ||
@@ -1397,8 +1397,8 @@
|| (ooffset > (long)other.length() - len)) {
return false;
}
- byte tv[] = value;
- byte ov[] = other.value;
+ byte[] tv = value;
+ byte[] ov = other.value;
if (coder() == other.coder()) {
return isLatin1()
? StringLatin1.regionMatchesCI(tv, toffset, ov, ooffset, len)
@@ -1431,8 +1431,8 @@
if (toffset < 0 || toffset > length() - prefix.length()) {
return false;
}
- byte ta[] = value;
- byte pa[] = prefix.value;
+ byte[] ta = value;
+ byte[] pa = prefix.value;
int po = 0;
int pc = pa.length;
if (coder() == prefix.coder()) {
@@ -3134,7 +3134,7 @@
* @return a {@code String} that contains the characters of the
* character array.
*/
- public static String valueOf(char data[]) {
+ public static String valueOf(char[] data) {
return new String(data);
}
@@ -3158,7 +3158,7 @@
* {@code offset+count} is larger than
* {@code data.length}.
*/
- public static String valueOf(char data[], int offset, int count) {
+ public static String valueOf(char[] data, int offset, int count) {
return new String(data, offset, count);
}
@@ -3175,7 +3175,7 @@
* {@code offset+count} is larger than
* {@code data.length}.
*/
- public static String copyValueOf(char data[], int offset, int count) {
+ public static String copyValueOf(char[] data, int offset, int count) {
return new String(data, offset, count);
}
@@ -3186,7 +3186,7 @@
* @return a {@code String} that contains the characters of the
* character array.
*/
- public static String copyValueOf(char data[]) {
+ public static String copyValueOf(char[] data) {
return new String(data);
}
@@ -3360,7 +3360,7 @@
* @param dstBegin the char index, not offset of byte[]
* @param coder the coder of dst[]
*/
- void getBytes(byte dst[], int dstBegin, byte coder) {
+ void getBytes(byte[] dst, int dstBegin, byte coder) {
if (coder() == coder) {
System.arraycopy(value, 0, dst, dstBegin << coder, value.length);
} else { // this.coder == LATIN && coder == UTF16