svn commit: r18225 - trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2010-04-08 16:21:17-0700
New Revision: 18225

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

Log:
ArgoEclipse merge.  New header.  Code simplification.  TODO

Modified: trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java?view=diff&pathrev=18225&r1=18224&r2=18225
==============================================================================
--- trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java	(original)
+++ trunk/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java	2010-04-08 16:21:17-0700
@@ -1,12 +1,13 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial framework 
  *    thn
  *****************************************************************************
  *
@@ -42,6 +43,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
@@ -211,22 +213,19 @@
     }
 
     public Collection<Stereotype> getStereotypes(Object ns) {
-        List<Stereotype> l = new ArrayList<Stereotype>();
         if (ns instanceof Profile) {
-            Iterator iter = ((Profile) ns).getOwnedStereotypes().iterator();
-            while (iter.hasNext()) {
-                l.add((Stereotype) iter.next());
-            }
+            return new ArrayList<Stereotype>(((Profile) ns).getOwnedStereotypes());
         }
-        return l;
+        return Collections.emptySet();
     }
 
     public Collection<Stereotype> getStereotypes(Collection models) {
-        List<Stereotype> l = new ArrayList<Stereotype>();
+        Collection<Stereotype> l = new ArrayList<Stereotype>();
         if (models != null) {
             for (Object ns : models) {
                 if (ns instanceof Profile) {
                     l.addAll(((Profile) ns).getOwnedStereotypes());
+                    // TODO: Do we really want stereotypes from nested packages?
                     Iterator<Package> iter = ((Profile) ns).getNestedPackages()
                             .iterator();
                     while (iter.hasNext()) {

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2526351

To unsubscribe from this discussion, e-mail: [[email protected]].
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.