The VolumeContentBuilder currently allows invalid sequences of operation, such as
newSequence(null);
newOnTocStart();
Doing so could throw an IllegalStateException, but it is really up to the implementation to do so. This causes unnecessary uncertainty which can be avoided by moving the state dependent methods to separate interfaces. E.g. newSequence(null) could return a FormatterCore for that sequence.
And newTocSequence(null) could return another interface containing the methods needed e.g. newOnTocStart() (which in turn could return FormatterCore);
Original issue reported on code.google.com by
joel.hak...@mtm.seon 21 May 2014 at 7:07