forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
28 lines (23 loc) · 655 Bytes
/
Test.java
File metadata and controls
28 lines (23 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
public class Test {
void f() throws Throwable {
// NON_COMPLIANT
this.finalize(); // $ Alert
}
void f1() throws Throwable {
f(); // COMPLIANT
}
@Override
protected void finalize() throws Throwable {
// COMPLIANT: If a subclass overrides `finalize()`
// it must invoke the superclass finalizer explicitly.
super.finalize();
}
// Overload of `finalize`
protected void finalize(String s) throws Throwable {
System.out.println(s);
}
// COMPLIANT: call to overload of `finalize`
void f2() throws Throwable {
this.finalize("overload");
}
}