Menu

#1545 [java] Symbol Table fails to resolve inner classes

PMD-5.5.3
closed
None
PMD
3-Major
Bug
5.5.2
2016-11-26
2016-11-14
Juan Sotuyo
No

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.

Discussion

  • Juan Sotuyo

    Juan Sotuyo - 2016-11-14

    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.

     
  • Juan Sotuyo

    Juan Sotuyo - 2016-11-15

    This fix is being impacted on https://github.com/pmd/pmd/pull/134

     
  • Andreas Dangel

    Andreas Dangel - 2016-11-26
    • status: open --> closed
    • Milestone: New Tickets --> PMD-5.5.3
     
  • Andreas Dangel

    Andreas Dangel - 2016-11-26

    This bug will be fixed with PMD 5.5.3 and later.

     

Log in to post a comment.