You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by na...@apache.org on 2009/09/09 06:27:04 UTC

svn commit: r812765 - /tuscany/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java

Author: nash
Date: Wed Sep  9 04:27:03 2009
New Revision: 812765

URL: http://svn.apache.org/viewvc?rev=812765&view=rev
Log:
Add null guards around uses of domainSearch reference to prevent unit test failure

Modified:
    tuscany/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java

Modified: tuscany/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java?rev=812765&r1=812764&r2=812765&view=diff
==============================================================================
--- tuscany/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java (original)
+++ tuscany/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java Wed Sep  9 04:27:03 2009
@@ -224,7 +224,9 @@
         
         // add it to the search index, contributionUpdated is called to guarantee 
         // only one contribution with the same URI in the index
-        this.domainSearch.contributionUpdated(contribution, contribution);
+        if (domainSearch != null) {  // can be null in unit tests
+            domainSearch.contributionUpdated(contribution, contribution);
+        }
         
         return key;
         
@@ -271,7 +273,9 @@
                 writeWorkspace(workspace);
                 
                 // delete it from the search index
-                this.domainSearch.contributionRemoved(contribution);
+                if (domainSearch != null) {  // can be null in unit tests
+                    domainSearch.contributionRemoved(contribution);
+                }
                 
                 return;