On Nov 18, 2015, at 6:32 PM, David Holmes <david.hol...@oracle.com> wrote: > >>> >>> Looks good to me too if IllegalStateException is used instead of >>> UnsupportedOperationException. >>> UnsuppportedOperationException is used when the operation is not >>> available, here, the same code can work or not depending how it is >>> called. >> >> But IllegalStateException is dependent on some state. There's no state >> involved here (in the sense "state" is characterized in Java). My 1st > > I agree with Remi. "state" doesn't have to mean fields - there are numerous > existing examples in the JDK. Calling a method in a context that is invalid > is an illegal state to me. IllegalThreadStateException would also work. But > UnsupportedOperationException ... more of a stretch.
+1