Update S1113: exception case for the finalizer attack #3687
This commit is contained in:
parent
5bea4e0f11
commit
0a7352fa9a
@ -23,13 +23,16 @@ More unexpected issues can be caused by relying on the `finalize()` method to pe
|
||||
public class MyClass {
|
||||
|
||||
@Override
|
||||
protected void finalize() {
|
||||
releaseSomeResources(); // Noncompliant
|
||||
protected void finalize() { // Noncompliant
|
||||
releaseSomeResources();
|
||||
}
|
||||
|
||||
}
|
||||
----
|
||||
|
||||
=== Exceptions
|
||||
|
||||
It is allowed to override the `finalize()` method as `final` method with an empty body, to prevent the _finalizer attack_ as described in _MET12-J-EX1_.
|
||||
|
||||
== Resources
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user