Emmanuel Lecharny created MAVIBOT-42:
----------------------------------------

             Summary: The TupleCursor always reuse the same internal tuple 
instance...
                 Key: MAVIBOT-42
                 URL: https://issues.apache.org/jira/browse/MAVIBOT-42
             Project: Mavibot
          Issue Type: Bug
    Affects Versions: 1.0.0-M5
            Reporter: Emmanuel Lecharny
            Assignee: Emmanuel Lecharny
            Priority: Blocker
             Fix For: 1.0.0-M6


When using the TupleCursor class, and iterate over the instance, using next(), 
the returned result is the internal  tuple instance. We cannot store the result 
somwhere, it will be replaced by a new value after the next iteration. For 
instance :

{code}
        List<Tuple<K, V>> tuples = new ArrayList<Tuple<K, V>>();

        while ( sortedTupleItr.hasNext() )
        {
            // Get the tuple to inject
            Tuple<K, V> tuple = sortedTupleItr.next();

            tuples.add( tuple );
        }

{code}

will produce a list of N times the last element...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to