lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Elschot (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2945) Surround Query doesn't properly handle equals/hashcode
Date Wed, 09 Mar 2011 16:57:00 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-2945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13004646#comment-13004646
] 

Paul Elschot commented on LUCENE-2945:
--------------------------------------

As to the patch of 5 March, QueryUtils uses clone() to test hashCode() and I'd rather not
support clone() because of the presence of the basic query factory and because I don't expect
reparsing to be a problem to start a clone.
Also implementing equals() on an anonymous inner class is not easily possible when hashCode()
uses a "qualified this", because equals() would need the same qualification on the other object
and I don't see a way to have that. An explicit reference from an object of a named static
inner class gets around that, and I am curious to know whether equals() could be implemented
without an explicit reference in this case.

I have started coding in these directions, once some tests pass I'll post a patch.


> Surround Query doesn't properly handle equals/hashcode
> ------------------------------------------------------
>
>                 Key: LUCENE-2945
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2945
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 3.0.3, 3.1, 4.0
>            Reporter: Grant Ingersoll
>            Assignee: Grant Ingersoll
>            Priority: Minor
>             Fix For: 3.1.1, 4.0
>
>         Attachments: LUCENE-2945-partial1.patch, LUCENE-2945.patch, LUCENE-2945.patch,
LUCENE-2945.patch
>
>
> In looking at using the surround queries with Solr, I am hitting issues caused by collisions
due to equals/hashcode not being implemented on the anonymous inner classes that are created
by things like DistanceQuery (branch 3.x, near line 76)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message