svn commit: r14299 - trunk/src/app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-04-06 18:44:02-0700
New Revision: 14299

Modified:
   trunk/src/app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java

Log:
Resolve warning about name collision

Modified: trunk/src/app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java?view=diff&rev=14299&p1=trunk/src/app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java&p2=trunk/src/app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java&r1=14298&r2=14299
==============================================================================
--- trunk/src/app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java	(original)
+++ trunk/src/app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java	2008-04-06 18:44:02-0700
@@ -121,7 +121,7 @@
         } catch (PropertyVetoException pve) {
             // nothing we can do about veto, so just ignore it
         }
-        // TODO: All super constrcutors should take a GraphModel
+        // TODO: All super constructors should take a GraphModel
         setGraphModel(createGraphModel());
     }
 
@@ -179,26 +179,26 @@
                 "No StateMachine given to create a Statechart diagram");
         }
         
-        Object namespace = Model.getFacade().getNamespace(machine);
-        if (namespace != null) {
-            return namespace;
+        Object ns = Model.getFacade().getNamespace(machine);
+        if (ns != null) {
+            return ns;
         }
         
         Object context = Model.getFacade().getContext(machine);
         if (Model.getFacade().isAClassifier(context)) {
-            namespace = context;
+            ns = context;
         } else if (Model.getFacade().isABehavioralFeature(context)) {
-            namespace = Model.getFacade().getNamespace( // or just the owner?
+            ns = Model.getFacade().getNamespace( // or just the owner?
                     Model.getFacade().getOwner(context));
         }
-        if (namespace == null) {
-            namespace = getProject().getRoot();
+        if (ns == null) {
+            ns = getProject().getRoots().iterator().next();
         }
-        if (namespace == null || !Model.getFacade().isANamespace(namespace)) {
+        if (ns == null || !Model.getFacade().isANamespace(ns)) {
             throw new IllegalStateException(
                     "Can not deduce a Namespace from a StateMachine");
         }
-        return namespace;
+        return ns;
     }
 
     /**
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.