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

firePropertyChange fires contrary to API specification

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 6
    • client-libs
    • sparc
    • solaris_10

      FULL PRODUCT VERSION :
      1.4.2, 1.5.0, 1.60

      ADDITIONAL OS VERSION INFORMATION :
      JDK issue

      A DESCRIPTION OF THE PROBLEM :

      The method firePropertyChange() for Objects in PropertyChangeSupport.java does not properly check for if oldValue == newValue prior to firing. In the case that oldValue and newValue are BOTH null the event should not be fired.


      public void firePropertyChange(String propertyName,
      Object oldValue, Object newValue) {
        if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
          return;
        }
        firePropertyChange(new PropertyChangeEvent(source, propertyName,
      oldValue, newValue));
      }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expect an additional check,

      if ( oldValue == newValue ) {
        return;
      }

      REPRODUCIBILITY :
      This bug can be reproduced always.
      ###@###.### 2005-06-28 17:48:38 GMT

            svioletsunw Scott Violet (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: