mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8338937: Optimize the string concatenation of ClassDesc
Reviewed-by: liach
This commit is contained in:
parent
d4dfa0127f
commit
55312e1549
7 changed files with 53 additions and 18 deletions
|
@ -4647,7 +4647,7 @@ public final class Class<T> implements java.io.Serializable,
|
|||
return Wrapper.forPrimitiveType(this).basicTypeString();
|
||||
|
||||
if (isArray()) {
|
||||
return "[" + componentType.descriptorString();
|
||||
return "[".concat(componentType.descriptorString());
|
||||
} else if (isHidden()) {
|
||||
String name = getName();
|
||||
int index = name.indexOf('/');
|
||||
|
@ -4660,11 +4660,7 @@ public final class Class<T> implements java.io.Serializable,
|
|||
.toString();
|
||||
} else {
|
||||
String name = getName().replace('.', '/');
|
||||
return new StringBuilder(name.length() + 2)
|
||||
.append('L')
|
||||
.append(name)
|
||||
.append(';')
|
||||
.toString();
|
||||
return StringConcatHelper.concat("L", name, ";");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue