svn commit: r13579 - trunk/src_new/org/argouml/uml/cognitive/critics/ChildGenUML.java
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: tfmorris
Date: 2007-09-24 01:00:23-0700
New Revision: 13579
Modified:
trunk/src_new/org/argouml/uml/cognitive/critics/ChildGenUML.java
Log:
Return empty set for children of Figs
Modified: trunk/src_new/org/argouml/uml/cognitive/critics/ChildGenUML.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/cognitive/critics/ChildGenUML.java?view=diff&rev=13579&p1=trunk/src_new/org/argouml/uml/cognitive/critics/ChildGenUML.java&p2=trunk/src_new/org/argouml/uml/cognitive/critics/ChildGenUML.java&r1=13578&r2=13579
==============================================================================
--- trunk/src_new/org/argouml/uml/cognitive/critics/ChildGenUML.java (original)
+++ trunk/src_new/org/argouml/uml/cognitive/critics/ChildGenUML.java 2007-09-24 01:00:23-0700
@@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
@@ -61,6 +62,7 @@
/**
* Reply a java.util.Enumeration of the children of the given Object
*
+ * @return an enumeration of the children of the given Object
* @see org.tigris.gef.util.ChildGenerator#gen(java.lang.Object)
* @deprecated for 0.25.4 by tfmorris. Only for use with legacy GEF
* interfaces. Use {@link #gen2(Object)} for new applications.
@@ -101,6 +103,8 @@
return figs.iterator();
}
}
+
+ // argument can be an instanceof a Fig which we ignore
if (Model.getFacade().isAPackage(o)) {
Collection ownedElements =
@@ -178,7 +182,11 @@
// TODO: We can probably use this instead of all of the above
// legacy UML 1.3 code - tfm - 20070915
- Collection result = Model.getFacade().getModelElementContents(o);
- return result.iterator();
+ if (Model.getFacade().isAUMLElement(o)) {
+ Collection result = Model.getFacade().getModelElementContents(o);
+ return result.iterator();
+ }
+
+ return Collections.EMPTY_SET.iterator();
}
}