diff options
author | Gary Gregory <garydgregory@gmail.com> | 2022-07-15 09:19:10 -0400 |
---|---|---|
committer | Gary Gregory <garydgregory@gmail.com> | 2022-07-15 09:19:10 -0400 |
commit | 78ce2d79f2b1341bfc366b1fde487d960493a08a (patch) | |
tree | 2f67e9b34d467d28d478df107d5ab8d4d373cffa /src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java | |
parent | d6ec3655b12c3b5e96de4570987dd7e64960487c (diff) | |
download | apache-commons-lang-78ce2d79f2b1341bfc366b1fde487d960493a08a.tar.gz |
More precise exceptions
Diffstat (limited to 'src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java')
-rw-r--r-- | src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java b/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java index db2ac8fdb..92c371591 100644 --- a/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java +++ b/src/main/java/org/apache/commons/lang3/event/EventListenerSupport.java @@ -23,6 +23,7 @@ import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.ArrayList; @@ -311,19 +312,19 @@ public class EventListenerSupport<L> implements Serializable { protected class ProxyInvocationHandler implements InvocationHandler { /** - * Propagates the method call to all registered listeners in place of - * the proxy listener object. + * Propagates the method call to all registered listeners in place of the proxy listener object. * - * @param unusedProxy the proxy object representing a listener on which the - * invocation was called; not used - * @param method the listener method that will be called on all of the - * listeners. + * @param unusedProxy the proxy object representing a listener on which the invocation was called; not used + * @param method the listener method that will be called on all of the listeners. * @param args event arguments to propagate to the listeners. * @return the result of the method call - * @throws Throwable if an error occurs + * @throws InvocationTargetException if an error occurs + * @throws IllegalArgumentException if an error occurs + * @throws IllegalAccessException if an error occurs */ @Override - public Object invoke(final Object unusedProxy, final Method method, final Object[] args) throws Throwable { + public Object invoke(final Object unusedProxy, final Method method, final Object[] args) + throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { for (final L listener : listeners) { method.invoke(listener, args); } |