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 2021/12/07 15:09:31 UTC

[sling-org-apache-sling-testing-osgi-mock] branch master updated: SLING-10975 osgi-mock: Remove duplicate handling of ServiceFactory implementation

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


The following commit(s) were added to refs/heads/master by this push:
     new 0ec917d  SLING-10975 osgi-mock: Remove duplicate handling of ServiceFactory implementation
0ec917d is described below

commit 0ec917d712c4869462171f0d9aba61eb351e4787
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Dec 7 16:07:12 2021 +0100

    SLING-10975 osgi-mock: Remove duplicate handling of ServiceFactory implementation
---
 .../apache/sling/testing/mock/osgi/MockServiceRegistration.java  | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

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 @@ class MockServiceRegistration<T> implements ServiceRegistration<T>, Comparable<M
         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