Changing the way we handle listener list.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@966606 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James W. Carman 2010-07-22 12:04:07 +00:00
parent a215284619
commit a7cb9414f7
1 changed files with 2 additions and 3 deletions

View File

@ -20,8 +20,8 @@ package org.apache.commons.lang3.event;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* An EventListenerSupport object can be used to manage a list of event listeners of a particular type.
@ -44,7 +44,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
*/
public class EventListenerSupport<L>
{
private final List<L> listeners;
private final List<L> listeners = new LinkedList<L>();
private final L proxy;
/**
@ -77,7 +77,6 @@ public class EventListenerSupport<L>
*/
public EventListenerSupport(Class<L> listenerInterface, ClassLoader classLoader)
{
listeners = new CopyOnWriteArrayList<L>();
proxy = listenerInterface.cast(Proxy.newProxyInstance(classLoader, new Class[]{listenerInterface},
new ProxyInvocationHandler()));
}