Why this matters
Finalizers are deprecated, unreliable, and can cause performance issues. Use try-with-resources or explicit cleanup methods instead.
Ensure that the `finalize()` method is not used. Use try-with-resources or explicit cleanup methods instead.
Finalizers are deprecated, unreliable, and can cause performance issues. Use try-with-resources or explicit cleanup methods instead.
Side-by-side examples engineers can pattern-match during review.
@Override
protected void finalize() {
// Cleanup logic
}// Use try-with-resources or explicit cleanup instead@Override
protected void finalize() {
// Cleanup logic
}// Use try-with-resources or explicit cleanup insteadFrom the same buckets as this rule.