You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Eran Sevi (JIRA)" <ji...@apache.org> on 2009/11/25 14:48:39 UTC

[jira] Updated: (LUCENENET-310) SegmentInfos class is not equatable

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

Eran Sevi updated LUCENENET-310:
--------------------------------

    Attachment: SegmentInfos.patch

Attached patch.

Fixed the issue by inheriting from "SupportClass.EquatableList<SegmentInfo>" instead of ArrayList.

This also required adding "virtual" modifier to EquatableList.Clone() method.

Eran.

> SegmentInfos class is not equatable
> -----------------------------------
>
>                 Key: LUCENENET-310
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-310
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Eran Sevi
>         Attachments: SegmentInfos.patch
>
>
> SegmentInfos class currently inherits from ArrayList which fails equations checks on this class.
> Test scenario:
> 1. Open an IndexWriter on an existing index. 
> 2. get reader from IndexWriter by calling IndexWriter.GetReader().
> 2. run reader.IsCurrent()
> Results:
> IsCurrent method returns false although the reader is indeed current.
> This is caused because IsCurrent() calls IndexWriter.NrtIsCurrent() which tries to match two equal SegmentInfos lists using the Equals method.
> The method returns false although the lists are identical.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.