lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Diss (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LUCENENET-529) ArgumentOutOfRangeException exception in Lucene.Net.Spatial.Util.FixedBitSet
Date Tue, 03 Dec 2013 14:43:45 GMT

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

John Diss updated LUCENENET-529:
--------------------------------

    Attachment: lucene.net.contrib.spatial.patch

Ok I dug deeper and found there is also a bug in the CompatibilityExtensions _docsWithFieldCache.
Currently it uses the  string key "field", but this means it returns the same cached object
regardless of the segment reader passed to it. i.e the cache appropriate to the first segment
reader encountered. In the case where subsequent segments are the same size or smaller it
doesn't crash, however the content is wrong, if the segment is larger you get an argument
exception. I have created a patch which changes the key to a struct containing the field and
a reference to the indexreader (Tuple would be a better key, but is not available in net35)
This works fine, however I am not sure if there is a danger that it would root a reader that
would otherwise be transient (I am a Lucene.net noob) 

> ArgumentOutOfRangeException exception in Lucene.Net.Spatial.Util.FixedBitSet
> ----------------------------------------------------------------------------
>
>                 Key: LUCENENET-529
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-529
>             Project: Lucene.Net
>          Issue Type: Bug
>          Components: Lucene.Net Contrib
>    Affects Versions: Lucene.Net 3.0.3
>         Environment: x64 asp.net mvc 5
>            Reporter: John Diss
>            Assignee: Itamar Syn-Hershko
>         Attachments: FixedBitSet.patch, lucene.net.contrib.spatial.patch
>
>
> When the FixedBitSet is created it is initialized to MaxDoc length, however MaxDoc should
be a valid index in the set. Either the indices need to be modified in the Get and Set methods
or the set is grown by 1. Growing the set  requires the fewest code changes elsewhere.
> Index: src/contrib/Spatial/Util/FixedBitSet.cs
> ===================================================================
> --- src/contrib/Spatial/Util/FixedBitSet.cs	(revision 1545729)
> +++ src/contrib/Spatial/Util/FixedBitSet.cs	(working copy)
> @@ -52,7 +52,7 @@
>  
>  		public FixedBitSet(int numBits)
>  		{
> -			bits = new BitArray(numBits);
> +			bits = new BitArray(numBits+1);
>  		}
>  
>  		/// <summary>



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message