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] [Resolved] (MAVIBOT-42) The TupleCursor always reuse the same internal tuple instance...
Date Tue, 23 Sep 2014 04:29:33 GMT

     [ https://issues.apache.org/jira/browse/MAVIBOT-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Lecharny resolved MAVIBOT-42.
--------------------------------------
    Resolution: Fixed

Fixed with http://svn.apache.org/r1626936

> 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