Skip to content
Permalink
Browse files
8263552: Use String.valueOf() for char-to-String conversions
Reviewed-by: redestad, vtewari, azvegint, chegar
  • Loading branch information
stsypanov authored and cl4es committed Mar 15, 2021
1 parent fac39fe commit c0176c42dcb013e966ec5a9709a46dc9845ac2d9
@@ -830,7 +830,7 @@ void readNonProxy(ObjectInputStream in)
char tcode = (char) in.readByte();
String fname = in.readUTF();
String signature = ((tcode == 'L') || (tcode == '[')) ?
in.readTypeString() : new String(new char[] { tcode });
in.readTypeString() : String.valueOf(tcode);
try {
fields[i] = new ObjectStreamField(fname, signature, false);
} catch (RuntimeException e) {
@@ -452,7 +452,7 @@ else if (expect.equalsIgnoreCase("permission type")) {
break;
default:
throw new ParsingException(st.lineno(), expect,
new String(new char[] {(char)lookahead}));
String.valueOf((char)lookahead));
}
return value;
}
@@ -49,7 +49,7 @@ public String next() {
char c = sig.charAt(idx);
if (c != '[' && c != 'L') {
++idx;
return new String(new char[] { c });
return String.valueOf(c);
}
// Walk forward to end of entry
int endIdx = idx;
@@ -57,7 +57,7 @@ private Wrapper(Class<?> wtype, String wtypeName, Class<?> ptype, String ptypeNa
this.wrapperType = wtype;
this.primitiveType = ptype;
this.basicTypeChar = tchar;
this.basicTypeString = new String(new char[] {this.basicTypeChar});
this.basicTypeString = String.valueOf(this.basicTypeChar);
this.emptyArray = emptyArray;
this.format = format;
this.wrapperSimpleName = wtypeName;
@@ -812,7 +812,7 @@ private String match(String expect)
break;
default:
throw new ParsingException(st.lineno(), expect,
new String(new char[] {(char)lookahead}));
String.valueOf((char)lookahead));
}
return value;
}
@@ -465,7 +465,7 @@ private Object toggleExponentSign(int offset, char aChar) throws
}
else {
string = getReplaceString(offset, replaceLength,
new String(new char[] { aChar }));
String.valueOf(aChar));
}
return stringToValue(string);
}

1 comment on commit c0176c4

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on c0176c4 Mar 15, 2021

Please sign in to comment.