diff --git a/src/changes/changes.xml b/src/changes/changes.xml index d6fd930ca..5d930e011 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -78,6 +78,7 @@ The type attribute can be add,update,fix,remove. Fix SpotBugs CT_CONSTRUCTOR_THROW in Base64 by implementing finalize() as a noop to avoid finalizer attacks. Increase message limit in IMAPReply.TAGGED_RESPONSE from 80 to 500 characters. Increase message limit in IMAPReply.UNTAGGED_RESPONSE from 160 to 500 characters. + Add missing Javadoc to ListenerList. org.apache.commons.net.nntp.Article#getChild(). org.apache.commons.net.nntp.Article#getNext(). diff --git a/src/main/java/org/apache/commons/net/util/ListenerList.java b/src/main/java/org/apache/commons/net/util/ListenerList.java index 9ac933e28..83a8162b5 100644 --- a/src/main/java/org/apache/commons/net/util/ListenerList.java +++ b/src/main/java/org/apache/commons/net/util/ListenerList.java @@ -32,14 +32,27 @@ public class ListenerList implements Serializable, Iterable { private final CopyOnWriteArrayList listeners; + /** + * Constructs a new instance. + */ public ListenerList() { listeners = new CopyOnWriteArrayList<>(); } + /** + * Adds the given listener to the end of this list. + * + * @param listener A listener. + */ public void addListener(final EventListener listener) { listeners.add(listener); } + /** + * Gets the number of elements in this list. + * + * @return the number of elements in this list + */ public int getListenerCount() { return listeners.size(); } @@ -60,7 +73,9 @@ private void readObject(final ObjectInputStream ignored) { } /** - * Serialization is unnecessary for this class. Reject attempts to do so until such time as the Serializable attribute can be dropped. + * Removes the first occurrence of the specified listener from this list, if it is present. + * + * @param listener listener to be removed from this list, if present. */ public void removeListener(final EventListener listener) { listeners.remove(listener);