lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Garski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENENET-218) Lucene.Net.Util.TestAttributeSource.TestCloneAttributes
Date Tue, 10 Nov 2009 04:19:32 GMT

    [ https://issues.apache.org/jira/browse/LUCENENET-218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12775271#action_12775271
] 

Michael Garski commented on LUCENENET-218:
------------------------------------------

OK, this one is a bit trickier than I first thought.  I've been mucking with different options
on how to address this test as well as the implementation in Lucene.Net.Util.AttributeSource.
 Here's the scoop:

Inside AttributeSource are two LinkedHashMaps, which cannot be swapped out with a direct native
collection due to the fact that the iterator must enumerate over the items in the way they
were added, which rules out any sort of Dictionary collection.  The SortedList and other sorted
collections sort based on the key value, not insertion order.  I tried weaving some hacks
in and was not satisfied with it as they were downright ugly.

I poked around with using LINQ to achieve the same functionality, but it's not as elegant
as using a native LinkedHashMap plus it requires the 3.5 framework and we are sticking with
the 2.0 framework for Lucene.Net 2.9.  I checked out a few free collection libraries (C5,
PowerCollections) and was not able to find a drop-in replacement for LinkedHashMap.

What I'm considering now is to create a class that is a composite of native .Net collections
that will provide the same functionality.  A little more work and a few extra unit tests will
be needed for it to ensure it works as it's supposed to, but in the end we will have our own
LinkedHashMap class that would reside in Lucene.Net.Util.

Any thoughts?

> Lucene.Net.Util.TestAttributeSource.TestCloneAttributes
> -------------------------------------------------------
>
>                 Key: LUCENENET-218
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-218
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Michael Garski
>
> The test is failing - I'm working on it :)

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


Mime
View raw message