rspec/rules/S1115/java/rule.adoc
2021-06-08 14:23:48 +02:00

26 lines
626 B
Plaintext

Overriding the Object.finalize() method should be done with caution and with a clear goal in mind so empty implementations or implementations containing only a call to 'super.finalize()' are useless and misleading.
The following code snippet illustrates this rule:
----
protected finalize() { //Non-Compliant
}
...
protected finalize() {
super.finalize(); //Non-Compliant
}
...
protected finalize() {
disposeSomeResources(); //Compliant
}
----
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]