src/share/classes/java/beans/PropertyChangeSupport.java

Print this page
rev 10053 : 8044855: Add missing @since tag under java.beans.*
Reviewed-by:

*** 75,84 **** --- 75,85 ---- * This class is serializable. When it is serialized it will save * (and restore) any listeners that are themselves serializable. Any * non-serializable listeners will be skipped during serialization. * * @see VetoableChangeSupport + * @since 1.1 */ public class PropertyChangeSupport implements Serializable { private PropertyChangeListenerMap map = new PropertyChangeListenerMap(); /**
*** 189,198 **** --- 190,200 ---- * If <code>propertyName</code> or <code>listener</code> is null, no * exception is thrown and no action is taken. * * @param propertyName The name of the property to listen on. * @param listener The PropertyChangeListener to be added + * @since 1.2 */ public void addPropertyChangeListener( String propertyName, PropertyChangeListener listener) { if (listener == null || propertyName == null) {
*** 214,223 **** --- 216,226 ---- * If <code>listener</code> is null, or was never added for the specified * property, no exception is thrown and no action is taken. * * @param propertyName The name of the property that was listened on. * @param listener The PropertyChangeListener to be removed + * @since 1.2 */ public void removePropertyChangeListener( String propertyName, PropertyChangeListener listener) { if (listener == null || propertyName == null) {
*** 275,284 **** --- 278,288 ---- * {@link #firePropertyChange(String, Object, Object)} method. * * @param propertyName the programmatic name of the property that was changed * @param oldValue the old value of the property * @param newValue the new value of the property + * @since 1.2 */ public void firePropertyChange(String propertyName, int oldValue, int newValue) { if (oldValue != newValue) { firePropertyChange(propertyName, Integer.valueOf(oldValue), Integer.valueOf(newValue)); }
*** 295,304 **** --- 299,309 ---- * {@link #firePropertyChange(String, Object, Object)} method. * * @param propertyName the programmatic name of the property that was changed * @param oldValue the old value of the property * @param newValue the new value of the property + * @since 1.2 */ public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) { if (oldValue != newValue) { firePropertyChange(propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue)); }
*** 310,319 **** --- 315,325 ---- * all properties or a property with the specified name. * <p> * No event is fired if the given event's old and new values are equal and non-null. * * @param event the {@code PropertyChangeEvent} to be fired + * @since 1.2 */ public void firePropertyChange(PropertyChangeEvent event) { Object oldValue = event.getOldValue(); Object newValue = event.getNewValue(); if (oldValue == null || newValue == null || !oldValue.equals(newValue)) {
*** 408,417 **** --- 414,424 ---- * those registered on all properties. If <code>propertyName</code> * is null, only check for listeners registered on all properties. * * @param propertyName the property name. * @return true if there are one or more listeners for the given property + * @since 1.2 */ public boolean hasListeners(String propertyName) { return this.map.hasListeners(propertyName); }