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

XMLWordPrintable

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

      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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: