Skip to content

Commit e8bdc8b

Browse files
committed
Make Member.getEnclosingCallable compatible with local interfaces
1 parent 608d24f commit e8bdc8b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

java/ql/lib/semmle/code/java/Member.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ class Member extends Element, Annotatable, Modifiable, @member {
4040

4141
/**
4242
* Gets the immediately enclosing callable, if this member is declared in
43-
* an anonymous or local class.
43+
* an anonymous or local class or interface.
4444
*/
4545
Callable getEnclosingCallable() {
46-
exists(NestedClass nc | this.getDeclaringType() = nc |
47-
nc.(AnonymousClass).getClassInstanceExpr().getEnclosingCallable() = result or
48-
nc.(LocalClassOrInterface).getLocalTypeDeclStmt().getEnclosingCallable() = result
46+
exists(NestedType nt | this.getDeclaringType() = nt |
47+
nt.(AnonymousClass).getClassInstanceExpr().getEnclosingCallable() = result or
48+
nt.(LocalClassOrInterface).getLocalTypeDeclStmt().getEnclosingCallable() = result
4949
)
5050
}
5151
}

0 commit comments

Comments
 (0)