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)
|
if (listener == null)
|
||||||
return;
|
return;
|
||||||
if (_firing) {
|
if (_firing) {
|
||||||
if (_newListeners == null)
|
if (_newListeners == null) {
|
||||||
_newListeners = newListenerCollection();
|
_newListeners = newListenerCollection();
|
||||||
_newListeners.addAll(_listeners);
|
_newListeners.addAll(_listeners);
|
||||||
|
}
|
||||||
_newListeners.add(listener);
|
_newListeners.add(listener);
|
||||||
} else {
|
} else {
|
||||||
if (_listeners == null)
|
if (_listeners == null)
|
||||||
|
@ -63,9 +64,10 @@ public abstract class AbstractEventManager implements EventManager {
|
||||||
if (listener == null)
|
if (listener == null)
|
||||||
return false;
|
return false;
|
||||||
if (_firing && _listeners.contains(listener)) {
|
if (_firing && _listeners.contains(listener)) {
|
||||||
if (_newListeners == null)
|
if (_newListeners == null) {
|
||||||
_newListeners = newListenerCollection();
|
_newListeners = newListenerCollection();
|
||||||
_newListeners.addAll(_listeners);
|
_newListeners.addAll(_listeners);
|
||||||
|
}
|
||||||
return _newListeners.remove(listener);
|
return _newListeners.remove(listener);
|
||||||
}
|
}
|
||||||
return _listeners != null && _listeners.remove(listener);
|
return _listeners != null && _listeners.remove(listener);
|
||||||
|
|
Loading…
Reference in New Issue