mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8263552: Use String.valueOf() for char-to-String conversions
Reviewed-by: redestad, vtewari, azvegint, chegar
This commit is contained in:
parent
fac39fe97a
commit
c0176c42dc
6 changed files with 6 additions and 6 deletions
|
@ -830,7 +830,7 @@ public class ObjectStreamClass implements Serializable {
|
|||
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 @@ final class CryptoPolicyParser {
|
|||
break;
|
||||
default:
|
||||
throw new ParsingException(st.lineno(), expect,
|
||||
new String(new char[] {(char)lookahead}));
|
||||
String.valueOf((char)lookahead));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ class SignatureIterator {
|
|||
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 @@ public enum Wrapper {
|
|||
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 @@ public class PolicyParser {
|
|||
break;
|
||||
default:
|
||||
throw new ParsingException(st.lineno(), expect,
|
||||
new String(new char[] {(char)lookahead}));
|
||||
String.valueOf((char)lookahead));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -465,7 +465,7 @@ public class NumberFormatter extends InternationalFormatter {
|
|||
}
|
||||
else {
|
||||
string = getReplaceString(offset, replaceLength,
|
||||
new String(new char[] { aChar }));
|
||||
String.valueOf(aChar));
|
||||
}
|
||||
return stringToValue(string);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue