Joe Soltzberg

9%
Flag icon
This finalizer can record a reference to the object in a static field, preventing it from being garbage collected. Once the malformed object has been recorded, it is a simple matter to invoke arbitrary methods on this object that should never have been allowed to exist in the first place. Throwing an exception from a constructor should be sufficient to prevent an object from coming into existence; in the presence of finalizers, it is not. Such attacks can have dire consequences. Final classes are immune to finalizer attacks because no one can write a malicious subclass of a final class. To ...more
Joe Soltzberg
It seems that all of these issues stem from a lack of 'guarantees'. Is this a problem that can be fixed more generally or is this 'unsolvable' to some extent?
Effective Java
Rate this book
Clear rating
Open Preview