You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by ma...@apache.org on 2011/10/28 14:18:13 UTC

svn commit: r1190269 - /incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Workspace.java

Author: marrs
Date: Fri Oct 28 12:18:13 2011
New Revision: 1190269

URL: http://svn.apache.org/viewvc?rev=1190269&view=rev
Log:
ACE-196 applied the patch (which also had ACE-195 in it)

Modified:
    incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Workspace.java

Modified: incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Workspace.java
URL: http://svn.apache.org/viewvc/incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Workspace.java?rev=1190269&r1=1190268&r2=1190269&view=diff
==============================================================================
--- incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Workspace.java (original)
+++ incubator/ace/trunk/ace-client-rest/src/main/java/org/apache/ace/client/rest/Workspace.java Fri Oct 28 12:18:13 2011
@@ -168,8 +168,21 @@ public class Workspace {
         }
         else {
             if (ARTIFACT2FEATURE.equals(entityType) || FEATURE2DISTRIBUTION.equals(entityType) || DISTRIBUTION2TARGET.equals(entityType)) {
-                RepositoryObject left = getLeft(entityType, attributes.get("left"));
-                RepositoryObject right = getRight(entityType, attributes.get("right"));
+
+                String leftAttribute = attributes.get("left");
+                String rightAttribute = attributes.get("right");
+
+                RepositoryObject left = null;
+                if(leftAttribute != null) {
+                    left = getLeft(entityType, leftAttribute);
+                }
+
+                RepositoryObject right = null;
+                if(rightAttribute != null) {
+                    right = getRight(entityType, rightAttribute);
+                }
+
+
                 if (left != null) {
                     if (left instanceof StatefulGatewayObject) {
                         if (((StatefulGatewayObject) left).isRegistered()) {
@@ -215,8 +228,19 @@ public class Workspace {
             }
         }
         if (ARTIFACT2FEATURE.equals(entityType) || FEATURE2DISTRIBUTION.equals(entityType) || DISTRIBUTION2TARGET.equals(entityType)) {
-            RepositoryObject left = getLeft(entityType, repositoryObject.getAttribute("left"));
-            RepositoryObject right = getRight(entityType, repositoryObject.getAttribute("right"));
+            String leftAttribute = repositoryObject.getAttribute("left");
+            String rightAttribute = repositoryObject.getAttribute("right");
+
+            RepositoryObject left = null;
+            if (leftAttribute != null) {
+                left = getLeft(entityType, leftAttribute);
+            }
+
+            RepositoryObject right = null;
+            if (rightAttribute != null) {
+                right = getRight(entityType, rightAttribute);
+            }
+
             if (left != null) {
                 if (left instanceof StatefulGatewayObject) {
                     if (((StatefulGatewayObject) left).isRegistered()) {