lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From laimis <>
Subject [GitHub] lucenenet pull request: use GetSafe instead of Get to match java b...
Date Sat, 02 May 2015 14:48:58 GMT
GitHub user laimis opened a pull request:

    use GetSafe instead of Get to match java behavior

    Discovered this issue while diagnosing why TestFilteredQuery.TestFilteredQuery_Mem was
failing randomly. It came down to a specific filter that needs to be selected with random
at this point:
    that gets selected together with "MatchAllDocs" query, called from here:
    The test fails with:
    Test(s) failed. System.ArgumentOutOfRangeException : Index was out of range. Must be non-negative
and less than the size of the collection.
    Parameter name: index
       at System.Collections.BitArray.Get(Int32 index)
    at Lucene.Net.Util.DocIdBitSet.Get(Int32 index) in z:\Builds\work\bcdbe6b8cc677a49\src\Lucene.Net.Core\Util\DocIdBitSet.cs:line
    Lucene.Net data / logic flow matches what Lucene is doing and in this case Lucene returns
False as bitset returns false in case the index is greater than the bitset length. While BitArray
returns exception in that case.
    There are more places in the code base that use BitArray.Get, not sure if it is worth
adjusting all of those to use SafeGet or instead fix those as they are discovered to lead
into issues. Open to the suggestions.   

You can merge this pull request into a Git repository by running:

    $ git pull docidbitsetfix

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #136
commit 3d6fb126fcda2dfc1e5a16908f6fb131e1b2b0b1
Author: Laimonas Simutis <>
Date:   2015-05-02T14:39:01Z

    use GetSafe instead of Get to simulate java behavior


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message