You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/10/13 14:11:05 UTC
(commons-net) branch master updated: Add missing Javadoc to ListenerList
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git
The following commit(s) were added to refs/heads/master by this push:
new 42348a5f Add missing Javadoc to ListenerList
42348a5f is described below
commit 42348a5f1808a02367fa96c99cb947e30eec2520
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Oct 13 10:10:58 2024 -0400
Add missing Javadoc to ListenerList
---
src/changes/changes.xml | 1 +
.../java/org/apache/commons/net/util/ListenerList.java | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index d6fd930c..5d930e01 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -78,6 +78,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix SpotBugs CT_CONSTRUCTOR_THROW in Base64 by implementing finalize() as a noop to avoid finalizer attacks.</action>
<action type="fix" dev="ggregory" due-to="Andreas Lemke, Gary Gregory">Increase message limit in IMAPReply.TAGGED_RESPONSE from 80 to 500 characters.</action>
<action type="fix" dev="ggregory" due-to="Andreas Lemke, Gary Gregory">Increase message limit in IMAPReply.UNTAGGED_RESPONSE from 160 to 500 characters.</action>
+ <action type="fix" dev="ggregory" due-to="Gary Gregory">Add missing Javadoc to ListenerList.</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary Gregory">org.apache.commons.net.nntp.Article#getChild().</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">org.apache.commons.net.nntp.Article#getNext().</action>
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 9ac933e2..83a8162b 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<EventListener> {
private final CopyOnWriteArrayList<EventListener> 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 @@ public class ListenerList implements Serializable, Iterable<EventListener> {
}
/**
- * 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);