Overview
finalize() can be so easily mis-used and cause serious performance problems for your system that many recommend not to use it. However something your shouldn't do is make it public.
Don't make finalize() public
From ServiceRegistry
public void finalize() throw Throwable {
deregisterAll();
super.finalise();
}
If you have clean up functionality you want the caller to make e.g.
close(); use a different method. In this case, the only method used is public, so there is no good reason to make the finalize() method public.
Comments
Post a Comment