Merge branch 'faster-symboltable' of https://github.com/Monits/pmd into pr-333
This commit is contained in:
@ -26,6 +26,7 @@ public class SourceFileScope extends AbstractJavaScope {
|
||||
|
||||
private final String packageImage;
|
||||
private final TypeSet types;
|
||||
private Map<String, Node> qualifiedTypeNames;
|
||||
|
||||
public SourceFileScope(final ClassLoader classLoader) {
|
||||
this(classLoader, "");
|
||||
@ -136,7 +137,12 @@ public class SourceFileScope extends AbstractJavaScope {
|
||||
* @return set of all types in this source file.
|
||||
*/
|
||||
public Map<String, Node> getQualifiedTypeNames() {
|
||||
return getSubTypes(null, this);
|
||||
if (qualifiedTypeNames != null) {
|
||||
return qualifiedTypeNames;
|
||||
}
|
||||
|
||||
qualifiedTypeNames = getSubTypes(null, this);
|
||||
return qualifiedTypeNames;
|
||||
}
|
||||
|
||||
private Map<String, Node> getSubTypes(String qualifyingName, Scope subType) {
|
||||
|
@ -20,7 +20,7 @@ than a 50% speedup). Future releases will keep improving on this area.
|
||||
Once again, *Symbol Table* has been an area of great performance improvements.
|
||||
This time we were able to further improve it's performance by roughly 10% on all
|
||||
supported languages. In *Java* in particular, several more improvements were possible,
|
||||
improving *Symbol Table* performance by a whooping 30%, that's over 5X faster
|
||||
improving *Symbol Table* performance by a whooping 80%, that's over 15X faster
|
||||
than PMD 5.5.1, when we first started working on it.
|
||||
|
||||
Java developers will also appreciate the revamp of `CloneMethodMustImplementCloneable`,
|
||||
|
Reference in New Issue
Block a user