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 2019/05/29 14:11:12 UTC

[sling-org-apache-sling-testing-osgi-mock] branch master updated: cosmetic: cleanup null-analysis annotations

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 6fe6505  cosmetic: cleanup null-analysis annotations
6fe6505 is described below

commit 6fe65051402302ba236369843d99d1f97f3a122c
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Wed Mar 27 11:51:08 2019 +0100

    cosmetic: cleanup null-analysis annotations
---
 .../org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java  | 5 +----
 .../java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java | 1 -
 .../apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java   | 1 -
 .../testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java     | 1 -
 4 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
index d2b87a6..e21e846 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
@@ -52,7 +52,6 @@ public class OsgiContextImpl {
     /**
      * Teardown actions after test method execution
      */
-    @SuppressWarnings("null")
     protected void tearDown() {
         if (componentContext != null) {
             // deactivate all services
@@ -72,7 +71,6 @@ public class OsgiContextImpl {
     /**
      * @return OSGi component context
      */
-    @SuppressWarnings("null")
     public final @NotNull ComponentContext componentContext() {
         if (this.componentContext == null) {
             this.componentContext = MockOsgi.newComponentContext();
@@ -83,7 +81,6 @@ public class OsgiContextImpl {
     /**
      * @return OSGi Bundle context
      */
-    @SuppressWarnings("null")
     public final @NotNull BundleContext bundleContext() {
         return componentContext().getBundleContext();
     }
@@ -197,7 +194,7 @@ public class OsgiContextImpl {
      * @return The services instances or an empty array.
      * @throws RuntimeException If the <code>filter</code> string is not a valid OSGi service filter string.
      */
-    @SuppressWarnings({ "unchecked", "null" })
+    @SuppressWarnings("unchecked")
     public final @NotNull <ServiceType> ServiceType @NotNull [] getServices(@NotNull final Class<ServiceType> serviceType, @Nullable final String filter) {
         try {
             ServiceReference[] serviceReferences = bundleContext().getServiceReferences(serviceType.getName(), filter);
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java
index 2e04eaa..8a536c5 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/ManifestScannerTest.java
@@ -25,7 +25,6 @@ import java.util.Collection;
 import org.junit.Test;
 import org.osgi.framework.Constants;
 
-@SuppressWarnings("null")
 public class ManifestScannerTest {
 
     /**
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java
index de663b4..187efbd 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/MockConfigurationAdminTest.java
@@ -32,7 +32,6 @@ import org.osgi.framework.ServiceReference;
 
 import com.google.common.collect.ImmutableMap;
 
-@SuppressWarnings("null")
 public class MockConfigurationAdminTest {
     
     private static final String[] TEST_ADAPTABLES = new String[] {
diff --git a/core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java b/core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java
index 9e69984..d174bf1 100644
--- a/core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java
+++ b/core/src/test/java/org/apache/sling/testing/mock/osgi/OsgiServiceUtilActivateDeactivateTest.java
@@ -36,7 +36,6 @@ import org.osgi.service.component.annotations.Deactivate;
 /**
  * Test different variants of activate/deactivate methods with varying signatures.
  */
-@SuppressWarnings("null")
 public class OsgiServiceUtilActivateDeactivateTest {
 
     private Map<String,Object> map = ImmutableMap.<String, Object>of("prop1", "value1",