hasChildElement: include method -> local class edges

This commit is contained in:
Chris Smowton
2022-10-10 15:54:35 +01:00
parent fff9a75ff8
commit b763c406b6
13 changed files with 107 additions and 2 deletions

View File

@@ -79,7 +79,10 @@ class Element extends @element, Top {
private predicate hasChildElement(Element parent, Element e) {
cupackage(e, parent)
or
enclInReftype(e, parent)
enclInReftype(e, parent) and
not e instanceof LocalClassOrInterface
or
e.(LocalClassOrInterface).getLocalTypeDeclStmt().getEnclosingCallable() = parent
or
not enclInReftype(e, _) and
e.(Class).getCompilationUnit() = parent