mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
29 lines
643 B
Java
29 lines
643 B
Java
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 {
|
|
// ...
|
|
}
|
|
|
|
void f2() throws Throwable {
|
|
// COMPLIANT: call to overload of `finalize`
|
|
this.finalize("overload");
|
|
}
|
|
|
|
}
|