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

Component.firePropertyChange(String, Object, Object) improvements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 6
    • client-libs
    • Fix Understood
    • generic
    • generic

      I noticed a couple improvements that could be made to Component.firePropertyChange(String, Object, Object), both based on the fact that it forwards the call on to java.beans.PropertyChangeSupport.firePropertyChange:

      1) PropertyChangeSupport.firePropertyChange states that, "no event is fired if old and new values are equal and non-null." Component.firePropertyChange() behaves the same way, but this clause is missing from the JavaDoc.

      2) firePropertyChange(String, Object, Object) in both PropertyChangeSupport and Component make this check:
      if (oldValue != null && newValue != null && oldValue.equals(newValue)) {
          return;
      }
      However, given that the Component version simply goes on to call the PropertyChangeSupport version, this check is redundant in Component.firePropertyChange().

            ant Anton Tarasov (Inactive)
            bchristi Brent Christian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: