You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Catherine Hope (JIRA)" <ji...@apache.org> on 2009/07/10 15:19:14 UTC

[jira] Created: (HARMONY-6267) Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same

Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same
--------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-6267
                 URL: https://issues.apache.org/jira/browse/HARMONY-6267
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
         Environment: all
            Reporter: Catherine Hope
            Priority: Minor


According to the spec for class AttributedCharacterIterator.Attribute, the equals method:
"Compares two objects for equality. This version only returns true for x.equals(y) if x and y refer to the same object, and guarantees this for all subclasses."

At the moment the method returns true if the objects were constructed with the same name.


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


[jira] Resolved: (HARMONY-6267) [classlib][text] Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison resolved HARMONY-6267.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M11

Thanks Catherine.

I applied a modified version of your patch to the TEXT module at repo revision r793553.

Since the definition of equals() was changed we also have to change the definition of hashCode() to match.  It now simply delegates to the Object.hashCode() but is marked as final.

That change also required fixing bogus tests for java.text.FieldPosition#hashCode() which makes assumptions about the hashCode implementation that are unwarranted by the spec.

Please check this now resolves your issue.


> [classlib][text] Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6267
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6267
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: all
>            Reporter: Catherine Hope
>            Assignee: Tim Ellison
>            Priority: Minor
>             Fix For: 5.0M11
>
>         Attachments: patch.txt
>
>
> According to the spec for class AttributedCharacterIterator.Attribute, the equals method:
> "Compares two objects for equality. This version only returns true for x.equals(y) if x and y refer to the same object, and guarantees this for all subclasses."
> At the moment the method returns true if the objects were constructed with the same name.

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


[jira] Updated: (HARMONY-6267) Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same

Posted by "Catherine Hope (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Catherine Hope updated HARMONY-6267:
------------------------------------

    Attachment: patch.txt

Attached patch contains a fix to java.text.AttributedCharacterIterator.Attribute to just perform a "==" in the equals() method.

The fix breaks the readResolve() methods of both that class and the java.text.DateFormat.Field subclass.  Patch also contains fix for these methods, which basically inlines the logic from the old equals method.  Also includes a new testcase "org.apache.harmony.text.tests.java.text.AttributedCharacterIteratorAttributeTest" that demonstrates the original problem and performs some additional tests on the other methods from that inner class, similarly to "DataFormatFieldTest" (there's a spelling mistake in that class name).

> Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6267
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6267
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: all
>            Reporter: Catherine Hope
>            Priority: Minor
>         Attachments: patch.txt
>
>
> According to the spec for class AttributedCharacterIterator.Attribute, the equals method:
> "Compares two objects for equality. This version only returns true for x.equals(y) if x and y refer to the same object, and guarantees this for all subclasses."
> At the moment the method returns true if the objects were constructed with the same name.

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


[jira] Updated: (HARMONY-6267) [classlib][text] Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison updated HARMONY-6267:
---------------------------------

    Summary: [classlib][text] Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same  (was: Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same)

> [classlib][text] Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6267
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6267
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: all
>            Reporter: Catherine Hope
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: patch.txt
>
>
> According to the spec for class AttributedCharacterIterator.Attribute, the equals method:
> "Compares two objects for equality. This version only returns true for x.equals(y) if x and y refer to the same object, and guarantees this for all subclasses."
> At the moment the method returns true if the objects were constructed with the same name.

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


[jira] Closed: (HARMONY-6267) [classlib][text] Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same

Posted by "Catherine Hope (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Catherine Hope closed HARMONY-6267.
-----------------------------------


Verified with svn.apache.org/repos/asf/harmony/enhanced/classlib/trunk/modules/text/src/main/java/java/text/AttributedCharacterIterator.java level 793553

> [classlib][text] Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6267
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6267
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: all
>            Reporter: Catherine Hope
>            Assignee: Tim Ellison
>            Priority: Minor
>             Fix For: 5.0M11
>
>         Attachments: patch.txt
>
>
> According to the spec for class AttributedCharacterIterator.Attribute, the equals method:
> "Compares two objects for equality. This version only returns true for x.equals(y) if x and y refer to the same object, and guarantees this for all subclasses."
> At the moment the method returns true if the objects were constructed with the same name.

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


[jira] Assigned: (HARMONY-6267) Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison reassigned HARMONY-6267:
------------------------------------

    Assignee: Tim Ellison

> Implementation of AttributedCharacterIterator.Attribute.equals should only return true if objects are the same
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6267
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6267
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: all
>            Reporter: Catherine Hope
>            Assignee: Tim Ellison
>            Priority: Minor
>         Attachments: patch.txt
>
>
> According to the spec for class AttributedCharacterIterator.Attribute, the equals method:
> "Compares two objects for equality. This version only returns true for x.equals(y) if x and y refer to the same object, and guarantees this for all subclasses."
> At the moment the method returns true if the objects were constructed with the same name.

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