Thats because firePropertyChange
will only fire the event if oldValue
is not equal to newValue
After 2 recursive runs, when the code reaches
propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(this, "date", oldDate, this.date));
the oldDate
and this.date
essentially become same (that is oldDate.equals(this.date) == true
) and it doesn't propagate the event to the listeners
Check the documentation of firePropertyChange
method
Fire an existing PropertyChangeEvent to any registered listeners. No event is fired if the given event's old and new values are equal and non-null.