svn commit: r13083 - branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: b00__1
Date: 2007-07-15 21:25:03-0700
New Revision: 13083
Modified:
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
Log:
Verify if the request to register a listener specify a valid EObject or EClass
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java?view=diff&rev=13083&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&r1=13082&r2=13083
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java 2007-07-15 21:25:03-0700
@@ -95,8 +95,6 @@
*/
private EUMLModelImplementation modelImpl;
- private Notifier rootContainer;
-
private RootContainerAdapter rootContainerAdapter = new RootContainerAdapter(this);
private Map<Object,List<Listener>> register = new HashMap<Object,List<Listener>>();
@@ -139,7 +137,8 @@
if (notifier == null || listener == null) {
throw new NullPointerException();
}
- if (!(notifier instanceof EObject || notifier instanceof Class)) {
+ if (!(notifier instanceof EObject || (notifier instanceof Class && EObject.class
+ .isAssignableFrom((Class) notifier)))) {
throw new IllegalArgumentException();
}
List<Listener> array = register.get(notifier);