directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] [Created] (MAVIBOT-42) The TupleCursor always reuse the same internal tuple instance...
Date Wed, 17 Sep 2014 13:12:33 GMT
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)

Mime
View raw message