lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <rcm...@gmail.com>
Subject Re: [jira] [Updated] (LUCENE-2989) TestCollectionUtil fails on IBM JRE
Date Thu, 24 Mar 2011 18:49:25 GMT
On Thu, Mar 24, 2011 at 2:28 PM, Chris Hostetter
<hossman_lucene@fucit.org> wrote:
>
> : The issue is a bug in IBM's Collections class. The List returned by
> : emptyList() does not implement RandomAccess.
> :
> : I fixed the test (unfortunately it's clear that emptyList() should
> : return a random access list, but it's not in the spec, so it's not
> : really IBM's fault). The fix is to use a realy empty Array and wrap it
> : with Arrays.asList().
>
> Should this make us rethink using Collections.emptyList() in the code
> base?  Should we be roling our own?
>

If you want to rely upon the fact that Collections.emptyList()
implements RandomAccess, then yes. But this seems pretty silly, since
you arent going to be randomly-accessing anything.... I think Uwe's
followup issue (LUCENE-2990) is the best solution.

its not a bug in IBM's JRE: nowhere does it say that
Collections.emptyList should implement RandomAccess in the javadocs.
The only other thing they say about this method is that it need not
create a new object (up to implementation), and that its immutable and
serializable.

http://download.oracle.com/javase/1.5.0/docs/api/java/util/Collections.html#emptyList()

it was a bug in our test.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message