svn commit: r13716 - trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-11-04 11:05:38-0700
New Revision: 13716

Modified:
   trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java

Log:
Fix isLeaf to match API and not throw if Element is of wrong type.

Change isAbstract to throw if argument isn't an Element.

Modified: trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&rev=13716&p1=trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java&p2=trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java&r1=13715&r2=13716
==============================================================================
--- trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	(original)
+++ trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	2007-11-04 11:05:38-0700
@@ -1983,10 +1983,10 @@
             return ((Classifier) handle).isAbstract();
         } else if (handle instanceof BehavioralFeature) {
             return ((BehavioralFeature) handle).isAbstract();
-        } else {
+        } else if (handle instanceof Element){
             return false;
-//            throw new IllegalArgumentException();
         }
+        throw new IllegalArgumentException();
     }
 
     public boolean isActive(Object handle) {
@@ -2050,7 +2050,12 @@
     }
 
     public boolean isLeaf(Object handle) {
-        return ((RedefinableElement) handle).isLeaf();
+        if (handle instanceof RedefinableElement) {
+            return ((RedefinableElement) handle).isLeaf();
+        } else if (handle instanceof Element) {
+            return false;
+        }
+        throw new IllegalArgumentException();
     }
 
     public boolean isNavigable(Object handle) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.