mirror of https://github.com/apache/openjpa.git
Fixed register/removeListener methods to not re-add once initialized.
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@498865 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
95544768f6
commit
5dddb15cb3
|
@ -45,9 +45,10 @@ public abstract class AbstractEventManager implements EventManager {
|
|||
if (listener == null)
|
||||
return;
|
||||
if (_firing) {
|
||||
if (_newListeners == null)
|
||||
if (_newListeners == null) {
|
||||
_newListeners = newListenerCollection();
|
||||
_newListeners.addAll(_listeners);
|
||||
_newListeners.addAll(_listeners);
|
||||
}
|
||||
_newListeners.add(listener);
|
||||
} else {
|
||||
if (_listeners == null)
|
||||
|
@ -63,9 +64,10 @@ public abstract class AbstractEventManager implements EventManager {
|
|||
if (listener == null)
|
||||
return false;
|
||||
if (_firing && _listeners.contains(listener)) {
|
||||
if (_newListeners == null)
|
||||
if (_newListeners == null) {
|
||||
_newListeners = newListenerCollection();
|
||||
_newListeners.addAll(_listeners);
|
||||
_newListeners.addAll(_listeners);
|
||||
}
|
||||
return _newListeners.remove(listener);
|
||||
}
|
||||
return _listeners != null && _listeners.remove(listener);
|
||||
|
|
Loading…
Reference in New Issue