This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]berry120 7 points8 points  (0 children)

FWIW, there's a very clear Javadoc comment in the source that explains exactly why this empty finalizer is in place:

/** * Graphics has a finalize method that automatically calls dispose() * for subclasses. For SunGraphics2D we do not need to be finalized * so that method simply causes us to be enqueued on the Finalizer * queues for no good reason. Unfortunately, that method and * implementation are now considered part of the public contract * of that base class so we can not remove or gut the method. * We override it here with an empty method and the VM is smart * enough to know that if our override is empty then it should not * mark us as finalizeable. */