First page Back Continue Last page Summary Graphics

We need nothrow guarantees


Notes:

The remarks in the previous section should make it clear that once we start to update the system state we needed to restrict ourselves to operations that don’t throw exceptions.
The more one works with exceptions the more it becomes apparent that there are sequences of operations that need to complete without error. The basic minimum is the ability to swap a new internal state for the old one and to release any freed resources. We see this in action in the last section where the new internal state is constructed before the pivot and then comes the swap and release sequence.
This is an area in which the Java standard library documentation is deficient – it only addresses checked exceptions. Consider, for example, java.awt.Graphics.dispose() – could this propagate an ‘out of memory’, 'null pointer' (or other unchecked) exception? I hope not - but without documentation of this point we don’t know.