svn commit: r13748 - trunk/src_new/org/argouml/ui/explorer/ExplorerTreeModel.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-11-11 00:21:11-0800
New Revision: 13748

Modified:
   trunk/src_new/org/argouml/ui/explorer/ExplorerTreeModel.java

Log:
rules are now guaranteed not to return null

Modified: trunk/src_new/org/argouml/ui/explorer/ExplorerTreeModel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/explorer/ExplorerTreeModel.java?view=diff&rev=13748&p1=trunk/src_new/org/argouml/ui/explorer/ExplorerTreeModel.java&p2=trunk/src_new/org/argouml/ui/explorer/ExplorerTreeModel.java&r1=13747&r2=13748
==============================================================================
--- trunk/src_new/org/argouml/ui/explorer/ExplorerTreeModel.java	(original)
+++ trunk/src_new/org/argouml/ui/explorer/ExplorerTreeModel.java	2007-11-11 00:21:11-0800
@@ -91,7 +91,8 @@
     /**
      * The children currently being updated.
      */
-    private List<ExplorerTreeNode> updatingChildren = new ArrayList<ExplorerTreeNode>();
+    private List<ExplorerTreeNode> updatingChildren =
+            new ArrayList<ExplorerTreeNode>();
 
     /**
      * A Runnable object that when executed does update some
@@ -450,22 +451,19 @@
                         + e.getStackTrace());
             }
 
-	    if (children != null) {
-	        for (Object child : children) {
-		    if (child == null) {
-			LOG.warn("PerspectiveRule " + rule + " wanted to "
-				 + "add null to the explorer tree!");
-		    } else if (!newChildren.contains(child)) {
-			newChildren.add(child);
-		    }
-		}
-	    }
+            for (Object child : children) {
+                if (child == null) {
+                    LOG.warn("PerspectiveRule " + rule + " wanted to "
+                            + "add null to the explorer tree!");
+                } else if (!newChildren.contains(child)) {
+                    newChildren.add(child);
+                }
+            }
+
 
             try {
                 Set dependencies = rule.getDependencies(modelElement);
-                if (dependencies != null) {
-                    deps.addAll(dependencies);
-                }
+                deps.addAll(dependencies);
             } catch (InvalidElementException e) {
                 LOG.debug("InvalidElementException in ExplorerTree : " 
                         + e.getStackTrace());
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.