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) {
82
82
enclInReftype ( e , parent ) and
83
83
not e instanceof LocalClassOrInterface
84
84
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
86
94
or
87
95
not enclInReftype ( e , _) and
88
96
e .( Class ) .getCompilationUnit ( ) = parent
You can’t perform that action at this time.
0 commit comments