mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8012656: cache frequently used name strings for DocImpl classes
Reviewed-by: darcy
This commit is contained in:
parent
66dde86ad0
commit
3c7d12fc05
4 changed files with 54 additions and 14 deletions
|
@ -341,9 +341,14 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
|
|||
* </pre>
|
||||
*/
|
||||
public String name() {
|
||||
return getClassName(tsym, false);
|
||||
if (name == null) {
|
||||
name = getClassName(tsym, false);
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* Return the qualified class name as a String.
|
||||
* <pre>
|
||||
|
@ -354,9 +359,14 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
|
|||
* </pre>
|
||||
*/
|
||||
public String qualifiedName() {
|
||||
return getClassName(tsym, true);
|
||||
if (qualifiedName == null) {
|
||||
qualifiedName = getClassName(tsym, true);
|
||||
}
|
||||
return qualifiedName;
|
||||
}
|
||||
|
||||
private String qualifiedName;
|
||||
|
||||
/**
|
||||
* Return unqualified name of type excluding any dimension information.
|
||||
* <p>
|
||||
|
@ -380,9 +390,14 @@ public class ClassDocImpl extends ProgramElementDocImpl implements ClassDoc {
|
|||
* Return the simple name of this type.
|
||||
*/
|
||||
public String simpleTypeName() {
|
||||
return tsym.name.toString();
|
||||
if (simpleTypeName == null) {
|
||||
simpleTypeName = tsym.name.toString();
|
||||
}
|
||||
return simpleTypeName;
|
||||
}
|
||||
|
||||
private String simpleTypeName;
|
||||
|
||||
/**
|
||||
* Return the qualified name and any type parameters.
|
||||
* Each parameter is a type variable with optional bounds.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue