mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +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();
|
char tcode = (char) in.readByte();
|
||||||
String fname = in.readUTF();
|
String fname = in.readUTF();
|
||||||
String signature = ((tcode == 'L') || (tcode == '[')) ?
|
String signature = ((tcode == 'L') || (tcode == '[')) ?
|
||||||
in.readTypeString() : new String(new char[] { tcode });
|
in.readTypeString() : String.valueOf(tcode);
|
||||||
try {
|
try {
|
||||||
fields[i] = new ObjectStreamField(fname, signature, false);
|
fields[i] = new ObjectStreamField(fname, signature, false);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
|
|
|
@ -452,7 +452,7 @@ final class CryptoPolicyParser {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ParsingException(st.lineno(), expect,
|
throw new ParsingException(st.lineno(), expect,
|
||||||
new String(new char[] {(char)lookahead}));
|
String.valueOf((char)lookahead));
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ class SignatureIterator {
|
||||||
char c = sig.charAt(idx);
|
char c = sig.charAt(idx);
|
||||||
if (c != '[' && c != 'L') {
|
if (c != '[' && c != 'L') {
|
||||||
++idx;
|
++idx;
|
||||||
return new String(new char[] { c });
|
return String.valueOf(c);
|
||||||
}
|
}
|
||||||
// Walk forward to end of entry
|
// Walk forward to end of entry
|
||||||
int endIdx = idx;
|
int endIdx = idx;
|
||||||
|
|
|
@ -57,7 +57,7 @@ public enum Wrapper {
|
||||||
this.wrapperType = wtype;
|
this.wrapperType = wtype;
|
||||||
this.primitiveType = ptype;
|
this.primitiveType = ptype;
|
||||||
this.basicTypeChar = tchar;
|
this.basicTypeChar = tchar;
|
||||||
this.basicTypeString = new String(new char[] {this.basicTypeChar});
|
this.basicTypeString = String.valueOf(this.basicTypeChar);
|
||||||
this.emptyArray = emptyArray;
|
this.emptyArray = emptyArray;
|
||||||
this.format = format;
|
this.format = format;
|
||||||
this.wrapperSimpleName = wtypeName;
|
this.wrapperSimpleName = wtypeName;
|
||||||
|
|
|
@ -812,7 +812,7 @@ public class PolicyParser {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new ParsingException(st.lineno(), expect,
|
throw new ParsingException(st.lineno(), expect,
|
||||||
new String(new char[] {(char)lookahead}));
|
String.valueOf((char)lookahead));
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -465,7 +465,7 @@ public class NumberFormatter extends InternationalFormatter {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
string = getReplaceString(offset, replaceLength,
|
string = getReplaceString(offset, replaceLength,
|
||||||
new String(new char[] { aChar }));
|
String.valueOf(aChar));
|
||||||
}
|
}
|
||||||
return stringToValue(string);
|
return stringToValue(string);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue