lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1415) MultiPhraseQuery has incorrect hashCode() implementation - Leads to Solr Cache misses
Date Thu, 09 Oct 2008 20:30:44 GMT

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

Uwe Schindler commented on LUCENE-1415:
---------------------------------------

That's clear: If you set the compilation option of Java 5/6 to limit to 1.4 features, this
prevents you from using language features of 5. But the underlying class library is from the
java distribution, the compiler comes from (Java5's rt.jar), which contains Arrays.hashCode().
The compiler cannot know, that Arrays.hashCode is not available in 1.4 unless it uses an old
rt.jar. If you want to be sure to compile 1.4 only, you have to install Java 1.4.

> MultiPhraseQuery has incorrect hashCode() implementation - Leads to Solr Cache misses
> -------------------------------------------------------------------------------------
>
>                 Key: LUCENE-1415
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1415
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4
>            Reporter: Todd Feak
>         Attachments: LUCENE-1415.patch, LUCENE-1415.patch, MultiPhraseQuery.java, MultiPhraseQueryTest.java
>
>
> I found this while hunting for the cause of Solr Cache misses.
> The MultiPhraseQuery class hashCode() implementation is non-deterministic. It uses termArrays.hashCode()
in the computation. The contents of that ArrayList are actually arrays themselves, which return
there reference ID as a hashCode instead of returning a hashCode which is based on the contents
of the array. I would suggest an implementation involving the Arrays.hashCode() method.
> I will try to submit a patch soon, off for today.

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


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


Mime
View raw message