-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
6
-
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().
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().