commit | 0ec917d712c4869462171f0d9aba61eb351e4787 | [log] [tgz] |
---|---|---|
author | Stefan Seifert <stefanseifert@users.noreply.github.com> | Tue Dec 07 16:07:12 2021 +0100 |
committer | Stefan Seifert <stefanseifert@users.noreply.github.com> | Tue Dec 07 16:07:12 2021 +0100 |
tree | 4b2a73aac906b5ca13b665959a55a4c911aeb516 | |
parent | 705a05c7b082532dbdf5350fe2093d9ce001d3b9 [diff] |
SLING-10975 osgi-mock: Remove duplicate handling of ServiceFactory implementation
diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java index 2b3aed7..a5e0983 100644 --- a/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java +++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/MockServiceRegistration.java
@@ -119,15 +119,8 @@ return clazzes; } - @SuppressWarnings({ "unchecked", "null" }) T getService() { - if (this.service instanceof ServiceFactory) { - ServiceFactory<T> factory = (ServiceFactory<T>)this.service; - return factory.getService(this.bundleContext.getBundle(), this); - } - else { - return this.service; - } + return this.service; } @Override