tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r812765 - /tuscany/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java
Date Wed, 09 Sep 2009 04:27:04 GMT
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;
                 



Mime
View raw message