Hi Roman, On Sat, 2006-11-25 at 22:05 +0100, Roman Kennke wrote: > Ok, I found my little test program and transformed it into a Mauve test. > I'm not sure if I should actually check this test in as it's a weird > corner case that at least stretches the spec. > CompositeView.modelToView() returns null exactly when: the passed in > bias is Position.Bias.Backwards and the pos is <= getStartOffset(). It > is arguable if that is correct, because the spec says this method throws > a BadLocationException when the pos argument is not a valid position in > this view. pos <= start offset with backwards translates to pos < > startoffset normal which clearly is not valid.
Thanks for checking! That is a weird case though. It looks more like an oversight in the other implementation. > I'm not sure if we should go so far and be conform in this corner case > here. I'm attaching the mauve test. I think this is not something we should really follow. The code we have is clearer now and I don't see any valid use for supporting the corner case. But you know this code better than me, so if you think it is better to return null in this particular case then please say so. Cheers, Mark
signature.asc
Description: This is a digitally signed message part
