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 2020/01/10 11:52:44 UTC

[sling-org-apache-sling-testing-resourceresolver-mock] branch master updated: cosmetic: eliminate null warnings

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-resourceresolver-mock.git


The following commit(s) were added to refs/heads/master by this push:
     new 345ca19  cosmetic: eliminate null warnings
345ca19 is described below

commit 345ca1936d227aa55cd6a66fbc41a22f67d24175
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Fri Jan 10 12:52:27 2020 +0100

    cosmetic: eliminate null warnings
---
 .../testing/resourceresolver/DeepReadModifiableValueMapDecorator.java   | 1 +
 .../testing/resourceresolver/MockResourceResolverFactoryOptions.java    | 2 --
 .../java/org/apache/sling/testing/resourceresolver/MockValueMap.java    | 2 +-
 .../java/org/apache/sling/testing/resourceresolver/ObjectConverter.java | 2 +-
 src/test/java/org/apache/sling/testing/resourceresolver/Convert.java    | 2 +-
 .../org/apache/sling/testing/resourceresolver/NtFileResourceTest.java   | 1 +
 .../sling/testing/resourceresolver/SlingCrudResourceResolverTest.java   | 1 +
 .../apache/sling/testing/resourceresolver/ValueMapDecoratorTest.java    | 1 +
 .../java/org/apache/sling/testing/resourceresolver/ValueMapTest.java    | 1 +
 9 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/resourceresolver/DeepReadModifiableValueMapDecorator.java b/src/main/java/org/apache/sling/testing/resourceresolver/DeepReadModifiableValueMapDecorator.java
index 6ad8d13..c2b1e5f 100644
--- a/src/main/java/org/apache/sling/testing/resourceresolver/DeepReadModifiableValueMapDecorator.java
+++ b/src/main/java/org/apache/sling/testing/resourceresolver/DeepReadModifiableValueMapDecorator.java
@@ -42,6 +42,7 @@ class DeepReadModifiableValueMapDecorator extends ValueMapDecorator implements M
         this.base = base;
     }
 
+    @SuppressWarnings("null")
     private ValueMap getValueMap(final String name) {
         final int pos = name.lastIndexOf("/");
         if ( pos == -1 ) {
diff --git a/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolverFactoryOptions.java b/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolverFactoryOptions.java
index 6f1e634..632a9da 100644
--- a/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolverFactoryOptions.java
+++ b/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolverFactoryOptions.java
@@ -42,12 +42,10 @@ public class MockResourceResolverFactoryOptions {
         return this;
     }
 
-    @SuppressWarnings("null")
     public @NotNull String @NotNull [] getSearchPaths() {
         return searchPaths;
     }
 
-    @SuppressWarnings("null")
     public @NotNull MockResourceResolverFactoryOptions setSearchPaths(@NotNull String @Nullable [] searchPaths) {
         if ( searchPaths == null ) {
             searchPaths = new String[] {};
diff --git a/src/main/java/org/apache/sling/testing/resourceresolver/MockValueMap.java b/src/main/java/org/apache/sling/testing/resourceresolver/MockValueMap.java
index 5932506..0b6ba9b 100644
--- a/src/main/java/org/apache/sling/testing/resourceresolver/MockValueMap.java
+++ b/src/main/java/org/apache/sling/testing/resourceresolver/MockValueMap.java
@@ -48,7 +48,7 @@ public class MockValueMap extends DeepReadModifiableValueMapDecorator implements
         super(resource, new ValueMapDecorator(convertForWriteAll(map)));
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "null", "unused" })
     @Override
     public <T> T get(String name, Class<T> type) {
         
diff --git a/src/main/java/org/apache/sling/testing/resourceresolver/ObjectConverter.java b/src/main/java/org/apache/sling/testing/resourceresolver/ObjectConverter.java
index 9899467..6d1e60a 100644
--- a/src/main/java/org/apache/sling/testing/resourceresolver/ObjectConverter.java
+++ b/src/main/java/org/apache/sling/testing/resourceresolver/ObjectConverter.java
@@ -42,7 +42,7 @@ final class ObjectConverter {
      * @param type type
      * @return the converted object
      */
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "null" })
     public static <T> T convert(Object obj, Class<T> type) {
         if (obj == null) {
             return null;
diff --git a/src/test/java/org/apache/sling/testing/resourceresolver/Convert.java b/src/test/java/org/apache/sling/testing/resourceresolver/Convert.java
index bdcd924..8614677 100644
--- a/src/test/java/org/apache/sling/testing/resourceresolver/Convert.java
+++ b/src/test/java/org/apache/sling/testing/resourceresolver/Convert.java
@@ -37,7 +37,7 @@ final class Convert {
         // static methods only
     }
     
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({ "unchecked", "null" })
     public static class ConversionAssert<T,U> {
         private final T input1;
         private final T input2;
diff --git a/src/test/java/org/apache/sling/testing/resourceresolver/NtFileResourceTest.java b/src/test/java/org/apache/sling/testing/resourceresolver/NtFileResourceTest.java
index fef5bc5..6c01d44 100644
--- a/src/test/java/org/apache/sling/testing/resourceresolver/NtFileResourceTest.java
+++ b/src/test/java/org/apache/sling/testing/resourceresolver/NtFileResourceTest.java
@@ -44,6 +44,7 @@ import com.google.common.collect.ImmutableMap;
  * Implements simple write and read resource and values test.
  * Sling CRUD API is used to create the test data.
  */
+@SuppressWarnings("null")
 public class NtFileResourceTest {
 
     private static final byte[] BINARY_VALUE = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 };
diff --git a/src/test/java/org/apache/sling/testing/resourceresolver/SlingCrudResourceResolverTest.java b/src/test/java/org/apache/sling/testing/resourceresolver/SlingCrudResourceResolverTest.java
index 4cbb042..0783f1d 100644
--- a/src/test/java/org/apache/sling/testing/resourceresolver/SlingCrudResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/resourceresolver/SlingCrudResourceResolverTest.java
@@ -53,6 +53,7 @@ import com.google.common.collect.Lists;
  * Implements simple write and read resource and values test.
  * Sling CRUD API is used to create the test data.
  */
+@SuppressWarnings("null")
 public class SlingCrudResourceResolverTest {
 
     private static final String STRING_VALUE = "value1";
diff --git a/src/test/java/org/apache/sling/testing/resourceresolver/ValueMapDecoratorTest.java b/src/test/java/org/apache/sling/testing/resourceresolver/ValueMapDecoratorTest.java
index 0b78f50..1067997 100644
--- a/src/test/java/org/apache/sling/testing/resourceresolver/ValueMapDecoratorTest.java
+++ b/src/test/java/org/apache/sling/testing/resourceresolver/ValueMapDecoratorTest.java
@@ -34,6 +34,7 @@ import org.junit.Test;
 /**
  * This is copied from org.apache.sling.api.wrappers.ValueMapDecoratorTest
  */
+@SuppressWarnings("null")
 public class ValueMapDecoratorTest {
 
     private Map<String, Object> map;
diff --git a/src/test/java/org/apache/sling/testing/resourceresolver/ValueMapTest.java b/src/test/java/org/apache/sling/testing/resourceresolver/ValueMapTest.java
index 4368683..916cf17 100644
--- a/src/test/java/org/apache/sling/testing/resourceresolver/ValueMapTest.java
+++ b/src/test/java/org/apache/sling/testing/resourceresolver/ValueMapTest.java
@@ -37,6 +37,7 @@ import com.google.common.collect.ImmutableMap;
 /**
  * Test different ValueMap variants.
  */
+@SuppressWarnings("null")
 public class ValueMapTest {
 
     private ResourceResolver resourceResolver;