dimalabs/ozone — pull request #131 by fhueske (2013-10-07 09:59:17+00:00)
Title: Keygrouped

Extended the KeyGroupedIteratorTest to check that the values iterator always returns the same object.
This is the expected behavior of a mutable object iterator.
With the current implementation two alternating records are returned, where the one that was not returned with the last next() call is used as a look-a-head record and changes its value with a hasNext() call. This leads to weird behaviors, e.g., to different behavior depending on whether a group has an even or odd number of elements.
The second commit fixes the bug by copying the return record before giving it to the user code. This is less efficient, but ensures that the user always receives the same object and that the value of the (single) returned object is only changed with a next() call.
This is a fix for issue #128.