File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
java/ql/lib/semmle/code/java Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,15 @@ private predicate hasChildElement(Element parent, Element e) {
8282 enclInReftype ( e , parent ) and
8383 not e instanceof LocalClassOrInterface
8484 or
85- e .( LocalClassOrInterface ) .getLocalTypeDeclStmt ( ) .getEnclosingCallable ( ) = parent
85+ // Reasoning: any specialised instance of a local class is supposed to belong to the general
86+ // case of its enclosing method because we don't instantiate specialised variants of either generic
87+ // functions or function bodies, and therefore the local class cannot be specialised with respect
88+ // to its enclosing reftypes.
89+ e .( LocalClassOrInterface )
90+ .getSourceDeclaration ( )
91+ .( LocalClassOrInterface )
92+ .getLocalTypeDeclStmt ( )
93+ .getEnclosingCallable ( ) = parent
8694 or
8795 not enclInReftype ( e , _) and
8896 e .( Class ) .getCompilationUnit ( ) = parent
You can’t perform that action at this time.
0 commit comments