From 7a96a96edc88c319d97a90f94147a854d00492bb Mon Sep 17 00:00:00 2001 From: nash Date: Wed, 9 Sep 2009 04:27:03 +0000 Subject: Add null guards around uses of domainSearch reference to prevent unit test failure git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@812765 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/domain/manager/impl/ContributionCollectionImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java') diff --git a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java index 6531d43e4a..ef23b1b4cd 100644 --- a/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java +++ b/branches/sca-java-1.x/modules/domain-manager/src/main/java/org/apache/tuscany/sca/domain/manager/impl/ContributionCollectionImpl.java @@ -224,7 +224,9 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl // 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 @@ public class ContributionCollectionImpl implements ItemCollection, LocalItemColl 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; -- cgit v1.2.3