dlmarion commented on PR #5785:
URL: https://github.com/apache/accumulo/pull/5785#issuecomment-3169079777

   > I think feedback regarding the method of fixing this warning would be 
helpful (making the class final vs. adding the finalize() method).
   
   I have no issue with making classes final where we can and where it makes 
sense. I'm not sure adding a finalizer to fix the others is a good long-term 
approach though it's likely the easiest fix. Finalizers themselves are 
[deprecated](https://openjdk.org/jeps/421) and will be removed in a future Java 
release. I'm wondering if fixing the objects so that they don't throw 
exceptions from the constructor is the better choice, for example, using an 
`init` method on the objects that needs to be called post-construction but 
before use. There is now a jvm option, `--finalization=disabled`, in JDK 18 
that disables all Finalizers as a step toward removal.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to