mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Java: Added nested local class test case
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
public class LocalClassInTestMethod {
|
||||
public void testNestedCase() {
|
||||
class OuterLocalClass {
|
||||
void func() {
|
||||
class NestedLocalClass {
|
||||
void nestedMethod() {
|
||||
System.exit(4); // $ SPURIOUS: Alert
|
||||
Runtime.getRuntime().halt(5); // $ SPURIOUS: Alert
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
OuterLocalClass outer = new OuterLocalClass();
|
||||
outer.func();
|
||||
}
|
||||
public void testNestedCase2() {
|
||||
class OuterLocalClass {
|
||||
class NestedLocalClass {
|
||||
void nestedMethod() {
|
||||
System.exit(4); // $ SPURIOUS: Alert
|
||||
Runtime.getRuntime().halt(5); // $ SPURIOUS: Alert
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user