Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 26b6581

Browse files
author
Henning Makholm
committed
test example for ODASA-6859
1 parent 6af8948 commit 26b6581

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • java/ql/test/query-tests/InnerClassCouldBeStatic

java/ql/test/query-tests/InnerClassCouldBeStatic/Classes.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,14 @@ class CouldBeStatic3 {
260260
};
261261
}
262262
}
263+
264+
/** Has a method that calls a constructor that accessing an enclosing instance of this class. */
265+
class CannotBeStatic4 {
266+
CannotBeStatic4() {
267+
System.out.println(foo);
268+
}
269+
void foo() {
270+
new CannotBeStatic4();
271+
}
272+
}
263273
}

0 commit comments

Comments
 (0)