2012/2/23 Jörn Kottmann <[email protected]> > On 02/23/2012 04:57 PM, Thilo Goetz wrote: > >> So if you ask me, the current behavior of getCoveredText() is >> fine, it just needs to be documented. >> > > +1 to add documentation. > > Shouldn't we then throw an exception as well when > the sofa is null? > > You want to get the text, that is either possible or not. > It should be easy for user code to detect that. > > With the current implementation you have to check > the range and for a null value.
I agree here that also explicitly handle when the sofa is null. However I don't like to just let the IndexOutOfBoundException raise as that may sound like a bug or unhandled situation while the API should explicitly declare a dedicated exception for when the begin and end offset don't cover a fully existing span of text. Tommaso > > > Jörn >
