[java] Symbol Table fails to resolve inner classes
A source code analyzer
Brought to you by:
adangel,
juansotuyo
Symbol Table relies on TypeSet to resolve types, but the resolution strategies omit Inner classes, doing something such as:
final SourceFileScope sfs = acu.getScope().getEnclosingScope(SourceFileScope.class); sfs.resolveType("InnerClass.TheInnerClass")
or
final SourceFileScope sfs = acu.getScope().getEnclosingScope(SourceFileScope.class); sfs.resolveType("TheInnerClass")
both fail. However, attempting to resolve "InnerClass$TheInnerClass"
works. The class is accesible to the classloader, just not properly resolved.
Actually, Inner Class Resolution needs a ClassScope... we should probably have a
resolveType(name)
on ClassScope, as we do on SourceFileScope.Will ge to it ASAP.
This fix is being impacted on https://github.com/pmd/pmd/pull/134
This bug will be fixed with PMD 5.5.3 and later.