You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2022/04/26 12:32:19 UTC
[sling-org-apache-sling-testing-osgi-mock] branch master updated: SLING-11280 : Reference without field and method throws exception
This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-osgi-mock.git
The following commit(s) were added to refs/heads/master by this push:
new 4b7a415 SLING-11280 : Reference without field and method throws exception
4b7a415 is described below
commit 4b7a41509a667a3f415665ea0ec357a055fa65e7
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Apr 26 14:32:13 2022 +0200
SLING-11280 : Reference without field and method throws exception
---
.../java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java | 5 -----
1 file changed, 5 deletions(-)
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java
index b2099e0..6adc7b3 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtil.java
@@ -657,11 +657,6 @@ final class OsgiServiceUtil {
String methodName = bind ? reference.getBind() : reference.getUnbind();
String fieldName = reference.getField();
- if (StringUtils.isEmpty(methodName) && StringUtils.isEmpty(fieldName)) {
- throw new RuntimeException("No bind/unbind method name or file name defined "
- + "for reference '" + reference.getName() + "' (" + reference.getInterfaceTypeAsClass().getName() + ") for class " + targetClass.getName());
- }
-
if (StringUtils.isNotEmpty(methodName) && serviceInfo != null) {
// 1. ServiceReference