svn commit: r14382 - trunk/src/app/src/org/argouml/uml/ui/behavior/state_machines/PropPanelCallEvent.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-04-18 20:30:50-0700
New Revision: 14382

Modified:
   trunk/src/app/src/org/argouml/uml/ui/behavior/state_machines/PropPanelCallEvent.java

Log:
Add TODO marking private namespace processing which should go away.  Java 5 loops

Modified: trunk/src/app/src/org/argouml/uml/ui/behavior/state_machines/PropPanelCallEvent.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/ui/behavior/state_machines/PropPanelCallEvent.java?view=diff&rev=14382&p1=trunk/src/app/src/org/argouml/uml/ui/behavior/state_machines/PropPanelCallEvent.java&p2=trunk/src/app/src/org/argouml/uml/ui/behavior/state_machines/PropPanelCallEvent.java&r1=14381&r2=14382
==============================================================================
--- trunk/src/app/src/org/argouml/uml/ui/behavior/state_machines/PropPanelCallEvent.java	(original)
+++ trunk/src/app/src/org/argouml/uml/ui/behavior/state_machines/PropPanelCallEvent.java	2008-04-18 20:30:50-0700
@@ -27,7 +27,6 @@
 import java.awt.event.ActionEvent;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 
 import org.argouml.i18n.Translator;
 import org.argouml.model.Model;
@@ -122,20 +121,21 @@
         if (Model.getFacade().isACallEvent(target)) {
             Object ns = Model.getFacade().getNamespace(target);
             if (Model.getFacade().isANamespace(ns)) {
-                Collection c =
+                Collection classifiers =
                     Model.getModelManagementHelper().getAllModelElementsOfKind(
                             ns,
                             Model.getMetaTypes().getClassifier());
-                Iterator i = c.iterator();
-                while (i.hasNext()) {
-                    ops.addAll(Model.getFacade().getOperations(i.next()));
+                for (Object classifier : classifiers) {
+                    ops.addAll(Model.getFacade().getOperations(classifier));
                 }
-                c = Model.getModelManagementHelper().getAllImportedElements(ns);
-                i = c.iterator();
-                while (i.hasNext()) {
-                    Object obj = i.next();
-                    if (Model.getFacade().isAClassifier(obj)) {
-                        ops.addAll(Model.getFacade().getOperations(obj));
+                
+                // TODO: getAllModelElementsOfKind should probably do this
+                // processing of imported elements automatically
+                for (Object importedElem : Model.getModelManagementHelper()
+                        .getAllImportedElements(ns)) {
+                    if (Model.getFacade().isAClassifier(importedElem)) {
+                        ops.addAll(Model.getFacade()
+                                .getOperations(importedElem));
                     }
                 }
             }
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.