You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Claude Warren <cl...@xenei.com> on 2012/11/17 22:18:54 UTC

ExtendedIterator toSet() issue

ExtendedIterator.toSet() documentation states that the elements are to
be returned in order.

But

NiceIterator.asSet() (the static that is, I suspect, used by many
implementations of ExtendedIterator) uses HashSet() in an intermediate
process.  This will change the order to the hash order.  Should this
not be a LinkedHashSet so as to maintain the original order?

-- 
I like: Like Like - The likeliest place on the web
Identity: https://www.identify.nu/user.php?claude@xenei.com
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: ExtendedIterator toSet() issue

Posted by Andy Seaborne <an...@apache.org>.
On 19/11/12 10:08, Chris Dollin wrote:
> On Saturday, November 17, 2012 09:18:54 PM Claude Warren wrote:
>> ExtendedIterator.toSet() documentation states that the elements are to
>> be returned in order.
>>
>> But
>>
>> NiceIterator.asSet() (the static that is, I suspect, used by many
>> implementations of ExtendedIterator) uses HashSet() in an intermediate
>> process.  This will change the order to the hash order.  Should this
>> not be a LinkedHashSet so as to maintain the original order?
>
> No.
>
> It's a bug in the documentation; it should not say "in order". (Probably
> a cutnpaste without subsequent editing.)
>
> Chris
>

Fixed.

	Andy


Re: ExtendedIterator toSet() issue

Posted by Chris Dollin <ch...@epimorphics.com>.
On Saturday, November 17, 2012 09:18:54 PM Claude Warren wrote:
> ExtendedIterator.toSet() documentation states that the elements are to
> be returned in order.
> 
> But
> 
> NiceIterator.asSet() (the static that is, I suspect, used by many
> implementations of ExtendedIterator) uses HashSet() in an intermediate
> process.  This will change the order to the hash order.  Should this
> not be a LinkedHashSet so as to maintain the original order?

No.

It's a bug in the documentation; it should not say "in order". (Probably
a cutnpaste without subsequent editing.) 

Chris

-- 
RIP Diana Wynne Jones, 1934 - 2011.

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)