cosmetic: eliminate some warnings

git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1775350 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java b/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java
index 8850ca5..4666bb9 100644
--- a/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java
+++ b/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java
@@ -60,7 +60,6 @@
      * @throws IOException If the error status cannot be reported back to the
      *             client.
      */
-    @SuppressWarnings("unused")
     protected void doPost(@Nonnull SlingHttpServletRequest request,
             @Nonnull SlingHttpServletResponse response) throws ServletException,
             IOException {
@@ -84,7 +83,6 @@
      * @throws IOException If the error status cannot be reported back to the
      *             client.
      */
-    @SuppressWarnings("unused")
     protected void doPut(@Nonnull SlingHttpServletRequest request,
             @Nonnull SlingHttpServletResponse response) throws ServletException,
             IOException {
@@ -108,7 +106,6 @@
      * @throws IOException If the error status cannot be reported back to the
      *             client.
      */
-    @SuppressWarnings("unused")
     protected void doDelete(@Nonnull SlingHttpServletRequest request,
             @Nonnull SlingHttpServletResponse response) throws ServletException,
             IOException {
diff --git a/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java b/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
index 66265c8..84d785b 100644
--- a/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
+++ b/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java
@@ -122,7 +122,6 @@
      * @throws IOException If the error status cannot be reported back to the
      *             client.
      */
-    @SuppressWarnings("unused")
     protected void doGet(@Nonnull SlingHttpServletRequest request,
             @Nonnull SlingHttpServletResponse response) throws ServletException,
             IOException {
@@ -147,7 +146,6 @@
      * @throws ServletException Not thrown by this implementation.
      * @throws IOException Not thrown by this implementation.
      */
-    @SuppressWarnings("unused")
     protected void doOptions(@Nonnull SlingHttpServletRequest request,
             @Nonnull SlingHttpServletResponse response) throws ServletException,
             IOException {
@@ -170,7 +168,6 @@
      * @throws IOException May be thrown if there is an problem sending back the
      *             request headers in the response stream.
      */
-    @SuppressWarnings("unused")
     protected void doTrace(@Nonnull SlingHttpServletRequest request,
             @Nonnull SlingHttpServletResponse response) throws ServletException,
             IOException {
@@ -227,7 +224,6 @@
      * @throws IOException If the error status cannot be reported back to the
      *             client.
      */
-    @SuppressWarnings("unused")
     protected void doGeneric(@Nonnull SlingHttpServletRequest request,
             @Nonnull SlingHttpServletResponse response) throws ServletException,
             IOException {
diff --git a/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java b/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java
index 6b86cb2..b9d442e 100644
--- a/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java
+++ b/src/main/java/org/apache/sling/api/wrappers/ResourceResolverWrapper.java
@@ -89,6 +89,7 @@
      *                resource for. This must not be <code>null</code>.
      * @return a wrapped resource obtained through the wrapped resource resolver
      */
+    @SuppressWarnings("deprecation")
     @Nonnull
     @Override
     public Resource resolve(@Nonnull HttpServletRequest request) {
diff --git a/src/main/java/org/apache/sling/api/wrappers/ValueMapDecorator.java b/src/main/java/org/apache/sling/api/wrappers/ValueMapDecorator.java
index 53e49ff..357ad5d 100644
--- a/src/main/java/org/apache/sling/api/wrappers/ValueMapDecorator.java
+++ b/src/main/java/org/apache/sling/api/wrappers/ValueMapDecorator.java
@@ -113,6 +113,7 @@
      * @param type the component type of the array
      * @return and array of type T
      */
+    @SuppressWarnings("unchecked")
     private <T> T[] convertToArray(Object obj, Class<T> type) {
         if (obj.getClass().isArray()) {
             final Object[] array = (Object[]) obj;
@@ -128,7 +129,6 @@
             }
             return resultList.toArray((T[]) Array.newInstance(type, resultList.size()));
         } else {
-            @SuppressWarnings("unchecked")
             final T singleValueResult = convert(obj, type);
             // return null for type conversion errors instead of single element array with value null
             if (singleValueResult == null) {
diff --git a/src/test/java/org/apache/sling/api/request/RequestUtilTest.java b/src/test/java/org/apache/sling/api/request/RequestUtilTest.java
index 12e0086..ad7295c 100644
--- a/src/test/java/org/apache/sling/api/request/RequestUtilTest.java
+++ b/src/test/java/org/apache/sling/api/request/RequestUtilTest.java
@@ -133,7 +133,6 @@
             public void flushBuffer() throws IOException {}
 
             @Override
-            @SuppressWarnings("deprecation")
             public void setStatus(int sc, String sm) {}
 
             @Override
@@ -158,7 +157,6 @@
             public void sendError(int sc) throws IOException {}
 
             @Override
-            @SuppressWarnings("deprecation")
             public String encodeUrl(String url) {
                 return null;
             }
@@ -169,7 +167,6 @@
             }
 
             @Override
-            @SuppressWarnings("deprecation")
             public String encodeRedirectUrl(String url) {
                 return null;
             }
diff --git a/src/test/java/org/apache/sling/api/wrappers/ResourceResolverWrapperTest.java b/src/test/java/org/apache/sling/api/wrappers/ResourceResolverWrapperTest.java
index 0d9d0c8..21617e5 100644
--- a/src/test/java/org/apache/sling/api/wrappers/ResourceResolverWrapperTest.java
+++ b/src/test/java/org/apache/sling/api/wrappers/ResourceResolverWrapperTest.java
@@ -82,6 +82,7 @@
         verify(wrappedResolver).resolve(PATH);
     }
 
+    @SuppressWarnings("deprecation")
     @Test
     public void testResolve2() throws Exception {
         final HttpServletRequest request = mock(HttpServletRequest.class);
@@ -232,6 +233,7 @@
     }
 
     @Test
+    @SuppressWarnings("unchecked")
     public void testQueryResources() throws Exception {
         final Map<String, Object> expected = mock(Map.class);
         final List<Map<String, Object>> list = new ArrayList<>();
@@ -260,6 +262,7 @@
     }
 
     @Test
+    @SuppressWarnings("unchecked")
     public void testClone() throws Exception {
         final Map<String, Object> authenticationInfo = mock(Map.class);
         final ResourceResolver clone = mock(ResourceResolver.class);
@@ -292,6 +295,7 @@
     }
 
     @Test
+    @SuppressWarnings("unchecked")
     public void testGetAttributeNames() throws Exception {
         final Iterator<String> attributeNames = mock(Iterator.class);
         when(wrappedResolver.getAttributeNames()).thenReturn(attributeNames);
@@ -320,6 +324,7 @@
     public void testCreate() throws Exception {
         final Resource parent = mock(Resource.class);
         final String name = "aName";
+        @SuppressWarnings("serial")
         final Map<String, Object> properties = new HashMap<String, Object>(){{
             put("jcr:primaryType", "nt:unstructured");
         }};