You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Paul Cowan (JIRA)" <ji...@apache.org> on 2007/03/08 06:15:24 UTC
[jira] Created: (LUCENE-828) Term's equals() throws
ClassCastException if passed something other than a Term
Term's equals() throws ClassCastException if passed something other than a Term
-------------------------------------------------------------------------------
Key: LUCENE-828
URL: https://issues.apache.org/jira/browse/LUCENE-828
Project: Lucene - Java
Issue Type: Bug
Affects Versions: 2.1
Reporter: Paul Cowan
Priority: Trivial
Attachments: termequals.patch
Term.equals(Object) does a cast to Term without checking if the other object is a Term.
It's unlikely that this would ever crop up but it violates the implied contract of Object.equals().
--
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
[jira] Resolved: (LUCENE-828) Term's equals() throws
ClassCastException if passed something other than a Term
Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Otis Gospodnetic resolved LUCENE-828.
-------------------------------------
Resolution: Fixed
Lucene Fields: [New, Patch Available] (was: [Patch Available, New])
Patch applied, thanks Paul!
> Term's equals() throws ClassCastException if passed something other than a Term
> -------------------------------------------------------------------------------
>
> Key: LUCENE-828
> URL: https://issues.apache.org/jira/browse/LUCENE-828
> Project: Lucene - Java
> Issue Type: Bug
> Affects Versions: 2.1
> Reporter: Paul Cowan
> Priority: Trivial
> Attachments: termequals.patch
>
>
> Term.equals(Object) does a cast to Term without checking if the other object is a Term.
> It's unlikely that this would ever crop up but it violates the implied contract of Object.equals().
--
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
[jira] Updated: (LUCENE-828) Term's equals() throws
ClassCastException if passed something other than a Term
Posted by "Paul Cowan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LUCENE-828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Cowan updated LUCENE-828:
------------------------------
Attachment: termequals.patch
Amendment to .equals() to deal with non-Term objects.
Also includes standard performance optimisation in the case that the two objects are identity-equal, and a test case (the last assertion of which fails on current trunk, but passes after patch is applies to Term).
> Term's equals() throws ClassCastException if passed something other than a Term
> -------------------------------------------------------------------------------
>
> Key: LUCENE-828
> URL: https://issues.apache.org/jira/browse/LUCENE-828
> Project: Lucene - Java
> Issue Type: Bug
> Affects Versions: 2.1
> Reporter: Paul Cowan
> Priority: Trivial
> Attachments: termequals.patch
>
>
> Term.equals(Object) does a cast to Term without checking if the other object is a Term.
> It's unlikely that this would ever crop up but it violates the implied contract of Object.equals().
--
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