[
https://issues.apache.org/jira/browse/SOLR-1019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676120#action_12676120
]
Hoss Man commented on SOLR-1019:
--------------------------------
bq. The bottom line is that absolute FP comparisons can result in unpredictable
behaviors, depending on the underlying implementation something that we want to
avoid.
The behavior of equality operators on floats is fairly explicit and unambiguous
in JLS s15.21 -- if a JVM implementation produces unexpected behavior on these
comparisons that's a bug in the JVM implementation.
It's not ConstantScorePrefixQuery's job (or the job of any other Query class)
to second guess whether the caller considers a boost value of X+epsilon to be
"close enough" to a boost value of X to consider them the same query.
(FWIW: I agree that equality tests on float/double values tend to indicate ...
i just disagree with the assessment that there actually is a mistake in these
specific cases)
> ConstantScorePrefixQuery.java - Absolute FP comparison on getBoost()
> ---------------------------------------------------------------------
>
> Key: SOLR-1019
> URL: https://issues.apache.org/jira/browse/SOLR-1019
> Project: Solr
> Issue Type: Bug
> Components: clients - java
> Affects Versions: 1.3
> Environment: Java 6, Tomcat 6
> Reporter: Kay Kay
> Attachments: SOLR-1019.patch
>
>
> Absolute FP comparisons are inherently unsafe. Comparisons of FP done under
> an epsilon resolution difference.
> affects ConstantScorePrefixQuery#toString() and #equals()
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.