Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6182612

java.awt.font.TransformAttribute does not implement equals or hashcode

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 6
    • Fix Version/s: 6
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
      2d
    • Resolved In Build:
      b33
    • CPU:
      generic
    • OS:
      generic

      Description

      TransformAttribute is an immutable wrapper for an AffineTransform that is used as the value for the TRANSFORM TextAttribute. Two TransformAttributes should compare equal when their internal AffineTransforms are equal, but because the current implementation inherits its equals implementation from Object, this doesn't work. This causes problems when comparing two Maps that contain mappings to TransformAttributes.

      Equals and hashcode should be overridden in TransformAttribute to do the right thing.

      In addition, TransformAttribute uses null to provide a lightweight representation of the identity transform. Since 1.2 versions of TransformAttribute did not do this, streamed-in versions of transform attribute will contain non-null identity transforms. The cleanest way to handle this is to implement readresolve to return the unique identity TransformAttribute for this case. As the identity TransformAttribute may be used in other contexts, the identifier for it should be exported.
      ###@###.### 10/21/04 16:52 GMT
      ###@###.### 10/21/04 17:10 GMT

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dougfelt Doug Felt
                Reporter:
                dougfelt Doug Felt
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: