You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2018/07/31 10:28:12 UTC
[sling-org-apache-sling-testing-osgi-mock] 02/03: SLING-7794 use
constant for '.target' suffix
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
commit 3cc2d81d747c715cf8356ef9d5a26eee6d1a91db
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Tue Jul 31 12:27:28 2018 +0200
SLING-7794 use constant for '.target' suffix
---
.../java/org/apache/sling/testing/mock/osgi/MockBundleContext.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java b/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
index 02836f4..07b80d2 100644
--- a/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
+++ b/src/main/java/org/apache/sling/testing/mock/osgi/MockBundleContext.java
@@ -56,6 +56,7 @@ import org.osgi.framework.ServiceObjects;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.service.component.ComponentConstants;
import com.google.common.collect.ImmutableList;
import com.google.common.io.Files;
@@ -144,7 +145,7 @@ class MockBundleContext implements BundleContext {
for (ReferenceInfo referenceInfo : affectedDynamicReferences) {
Reference reference = referenceInfo.getReference();
// Look for a target override
- Object o = referenceInfo.getServiceRegistration().getProperties().get(reference.getName() + ".target");
+ Object o = referenceInfo.getServiceRegistration().getProperties().get(reference.getName() + ComponentConstants.REFERENCE_TARGET_SUFFIX);
if (o != null && o instanceof String) {
reference = new DynamicReference(reference,(String)o);
}