
org.sonar.l10n.squidjava.rules.squid.S1175.html Maven / Gradle / Ivy
Object.finalize()
is called by the Garbage Collector sometime after the object became unreferenced.
Overloading this method is misleading:
- The overloaded method will not be called by the Garbage Collector.
- Users are not expected to call
Object.finalize()
and will get confused.
Another name should be picked for the method.
The following code:
public void finalize(int someParameter) { // Non-Compliant
/* ... */
}
should be refactored into:
public void someBetterName(int someParameter) { // Compliant
/* ... */
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy