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

java.awt.DisplayMode.equals( DisplayMode ) does not check for null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs
    • 2d
    • x86
    • windows_2000



      Name: gm110360 Date: 11/19/2001


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

      As can be seen from DisplayMode source equals( DisplayMode ) doesn't check null.

          public boolean equals(DisplayMode dm) {
              return (getHeight() == dm.getHeight()
                  && getWidth() == dm.getWidth()
                  && getBitDepth() == dm.getBitDepth()
                  && getRefreshRate() == dm.getRefreshRate());
          }

      Also, shouldn't DisplayMode override equals( Object ) and call equals( displayMode ) if obj instanceof DisplayMode?
      (Review ID: 134949)
      ======================================================================

            chaasesunw Chet Haase (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: