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

java.awt.geom.Area.equals(Object) not overridden

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.3.0, 5.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_9

      Description

      Name: yyT116575 Date: 11/21/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)


      Design-Problem in java.awt.geom.Area:
      The equals-Method is redefined in Area, but as the argument of equals in
      class Area is Area and not Object, equals is not overridden but overloaded!
      If such objects are included in a Set (e.g.) they are not considered as equal.

      Example:
      java.awt.geom.Area a1 = new java.awt.geom.Area();
      java.awt.geom.Area a2 = new java.awt.geom.Area();
      System.out.println(a1 == a2); // false
      System.out.println(a1.equals(a2)); // true
      System.out.println(a1.equals((Object)a2)); // false !!

      If the behavior is intended, then the name of the method should probably
      be changed.
      (Review ID: 112539)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kaddepalli Krishna Addepalli
              Reporter:
              yyoungsunw Yung-ching Young (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: