Java: exclude overloads of finalize

This commit is contained in:
Jami Cogswell
2025-03-27 19:33:38 -04:00
parent f73eda0c38
commit ed22a16f32
5 changed files with 14 additions and 15 deletions

View File

@@ -1,2 +1 @@
| Test.java:4:9:4:23 | finalize(...) | Call to 'finalize'. |
| Test.java:25:9:25:33 | finalize(...) | Call to 'finalize'. |
| Test.java:4:9:4:23 | finalize(...) | Call to 'finalize()'. |

View File

@@ -10,7 +10,7 @@ public class Test {
@Override
protected void finalize() throws Throwable {
// COMPLIANT: If a subclass overrides `finalize`
// COMPLIANT: If a subclass overrides `finalize()`
// it must invoke the superclass finalizer explicitly.
super.finalize();
}
@@ -20,9 +20,9 @@ public class Test {
System.out.println(s);
}
// NON_COMPLIANT: call to overload of `finalize`
// COMPLIANT: call to overload of `finalize`
void f2() throws Throwable {
this.finalize("overload"); // $ Alert
this.finalize("overload");
}
}