org.sonar.l10n.java.rules.squid.ObjectFinalizeCheck.html Maven / Gradle / Ivy
The newest version!
According to the official javadoc documentation, this Object.finalize() is called by the garbage collector on an object when garbage collection determines that there are no more references to the object. Calling this method explicitly breaks this contract and so is misleading.
Noncompliant Code Example
public void dispose() throws Throwable {
this.finalize(); // Non-Compliant
}
See
- MITRE, CWE-586 - Explicit Call to Finalize()
- CERT, MET12-J - Do not use finalizers
© 2015 - 2025 Weber Informatics LLC | Privacy Policy