Thilo Goetz wrote: > Jörn Kottmann wrote: >> Thilo Goetz wrote: >>> Jörn Kottmann wrote: >>> >>>> Thilo Goetz wrote: >>>> >>>>> Jörn Kottmann wrote: >>>>> >>>>> >>>>>> This methods calls Collections.binarySearch. >>>>>> >>>>>> I doubt that the call is correct since binarySearch >>>>>> assumes that the passed objects are Comparable which >>>>>> FeatureStructure is not. >>>>>> I have seen similar code in Subiterator.moveTo where I think its >>>>>> correct. >>>>>> >>>>>> Are UnambiguousIteratorImpl and Subiterator only made for AnnotationFS >>>>>> objects ? >>>>>> >>>>> Yes. Does that make it correct? >>>>> >>>> No, Subiterator calls a different binarySearch method which takes >>>> a Comparator. We should then do the same in UnambiguousIteratorImpl. >>>> Is there a test for this iterator ? For me it looks like that the moveTo >>>> method >>>> is broken. >>>> >>>> Jörn >>>> >>> I'll check, but I may not get to it till tomorrow. >>> >> Did you check it ? Would like to get it fixed so I can continue to work >> on generics in the cas.impl package. >> >> >> Jörn > > You are quite right, UnambiguousIteratorImpl needs to do the same > as Subiterator. I'll fix it right now. > > --Thilo
Done, and added a test case to the SubIterator test, which tests for the same issue (see svn comment). There's an UnambiguousIteratorTest, which doesn't do anything. It looks like somebody started writing a test, and never finished. I may remove that test case later. Anyway, please carry on ;-) If you find more skeletons, let me know. --Thilo
