Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C052D17F5E for ; Tue, 17 Feb 2015 10:32:27 +0000 (UTC) Received: (qmail 92679 invoked by uid 500); 17 Feb 2015 10:32:24 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 92540 invoked by uid 500); 17 Feb 2015 10:32:24 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 92524 invoked by uid 99); 17 Feb 2015 10:32:24 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2015 10:32:24 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 51B58AC0154 for ; Tue, 17 Feb 2015 10:32:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1660344 [2/2] - in /sling/trunk/bundles/api: ./ src/main/java/org/apache/sling/api/ src/main/java/org/apache/sling/api/adapter/ src/main/java/org/apache/sling/api/auth/ src/main/java/org/apache/sling/api/request/ src/main/java/org/apache/s... Date: Tue, 17 Feb 2015 10:32:23 -0000 To: commits@sling.apache.org From: kwin@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150217103224.51B58AC0154@hades.apache.org> Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java?rev=1660344&r1=1660343&r2=1660344&view=diff ============================================================================== --- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java (original) +++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java Tue Feb 17 10:32:22 2015 @@ -18,6 +18,7 @@ */ package org.apache.sling.api.servlets; +import javax.annotation.Nonnull; import javax.servlet.Servlet; import org.apache.sling.api.SlingHttpServletRequest; @@ -62,7 +63,7 @@ public interface ServletResolver { * request or if no servlet could be resolved to handle the * request. */ - Servlet resolveServlet(SlingHttpServletRequest request); + @Nonnull Servlet resolveServlet(@Nonnull SlingHttpServletRequest request); /** * Resolves a javax.servlet.Servlet whose @@ -90,7 +91,7 @@ public interface ServletResolver { * request. * @since 2.1 (Sling API Bundle 2.1.0) */ - Servlet resolveServlet(Resource resource, String scriptName); + @Nonnull Servlet resolveServlet(@Nonnull Resource resource, @Nonnull String scriptName); /** * Resolves a javax.servlet.Servlet whose @@ -117,6 +118,6 @@ public interface ServletResolver { * request. * @since 2.1 (Sling API Bundle 2.1.0) */ - Servlet resolveServlet(ResourceResolver resolver, String scriptName); + @Nonnull Servlet resolveServlet(@Nonnull ResourceResolver resolver, @Nonnull String scriptName); } Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java?rev=1660344&r1=1660343&r2=1660344&view=diff ============================================================================== --- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java (original) +++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java Tue Feb 17 10:32:22 2015 @@ -20,6 +20,7 @@ import java.io.IOException; import java.lang.reflect.Method; import java.util.Map; +import javax.annotation.Nonnull; import javax.servlet.ServletException; import org.apache.sling.api.SlingHttpServletRequest; @@ -60,8 +61,8 @@ public class SlingAllMethodsServlet exte * client. */ @SuppressWarnings("unused") - protected void doPost(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected void doPost(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { handleMethodNotImplemented(request, response); } @@ -84,8 +85,8 @@ public class SlingAllMethodsServlet exte * client. */ @SuppressWarnings("unused") - protected void doPut(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected void doPut(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { handleMethodNotImplemented(request, response); } @@ -108,8 +109,8 @@ public class SlingAllMethodsServlet exte * client. */ @SuppressWarnings("unused") - protected void doDelete(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected void doDelete(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { handleMethodNotImplemented(request, response); } @@ -131,8 +132,8 @@ public class SlingAllMethodsServlet exte * @throws ServletException Forwarded from any of the dispatched methods * @throws IOException Forwarded from any of the dispatched methods */ - protected boolean mayService(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected boolean mayService(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { // assume the method is known for now @@ -175,8 +176,8 @@ public class SlingAllMethodsServlet exte * @return A StringBuffer containing the list of HTTP methods * supported. */ - protected StringBuffer getAllowedRequestMethods( - Map declaredMethods) { + protected @Nonnull StringBuffer getAllowedRequestMethods( + @Nonnull Map declaredMethods) { StringBuffer allowBuf = super.getAllowedRequestMethods(declaredMethods); // add more method names depending on the methods found Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java?rev=1660344&r1=1660343&r2=1660344&view=diff ============================================================================== --- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java (original) +++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java Tue Feb 17 10:32:22 2015 @@ -26,6 +26,7 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.Map; +import javax.annotation.Nonnull; import javax.servlet.GenericServlet; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; @@ -89,8 +90,8 @@ public class SlingSafeMethodsServlet ext * {@link #doGet(SlingHttpServletRequest, SlingHttpServletResponse)} * method called by this implementation. */ - protected void doHead(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected void doHead(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { // the null-output wrapper @@ -121,8 +122,8 @@ public class SlingSafeMethodsServlet ext * client. */ @SuppressWarnings("unused") - protected void doGet(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected void doGet(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { handleMethodNotImplemented(request, response); } @@ -146,8 +147,8 @@ public class SlingSafeMethodsServlet ext * @throws IOException Not thrown by this implementation. */ @SuppressWarnings("unused") - protected void doOptions(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected void doOptions(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { Map methods = getAllDeclaredMethods(getClass()); StringBuffer allowBuf = getAllowedRequestMethods(methods); @@ -169,8 +170,8 @@ public class SlingSafeMethodsServlet ext * request headers in the response stream. */ @SuppressWarnings("unused") - protected void doTrace(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected void doTrace(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { String CRLF = "\r\n"; @@ -226,8 +227,8 @@ public class SlingSafeMethodsServlet ext * client. */ @SuppressWarnings("unused") - protected void doGeneric(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected void doGeneric(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { handleMethodNotImplemented(request, response); } @@ -254,8 +255,8 @@ public class SlingSafeMethodsServlet ext * @throws ServletException Forwarded from any of the dispatched methods * @throws IOException Forwarded from any of the dispatched methods */ - protected boolean mayService(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected boolean mayService(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { // assume the method is known for now @@ -290,8 +291,8 @@ public class SlingSafeMethodsServlet ext * @param response The HTTP response to which the error status is sent. * @throws IOException Thrown if the status cannot be sent to the client. */ - protected void handleMethodNotImplemented(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws IOException { + protected void handleMethodNotImplemented(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws IOException { String protocol = request.getProtocol(); String msg = "Method " + request.getMethod() + " not supported"; @@ -336,8 +337,8 @@ public class SlingSafeMethodsServlet ext * {@link #doGeneric(SlingHttpServletRequest, SlingHttpServletResponse)} * methods. */ - protected void service(SlingHttpServletRequest request, - SlingHttpServletResponse response) throws ServletException, + protected void service(@Nonnull SlingHttpServletRequest request, + @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { // first try to handle the request by the known methods @@ -366,7 +367,7 @@ public class SlingSafeMethodsServlet ext * {@link #service(SlingHttpServletRequest, SlingHttpServletResponse)} * called. */ - public void service(ServletRequest req, ServletResponse res) + public void service(@Nonnull ServletRequest req, @Nonnull ServletResponse res) throws ServletException, IOException { if ((req instanceof SlingHttpServletRequest) @@ -386,7 +387,7 @@ public class SlingSafeMethodsServlet ext * Returns the simple class name of this servlet class. Extensions of this * class may overwrite to return more specific information. */ - public String getServletInfo() { + public @Nonnull String getServletInfo() { return getClass().getSimpleName(); } Modified: sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/package-info.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/package-info.java?rev=1660344&r1=1660343&r2=1660344&view=diff ============================================================================== --- sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/package-info.java (original) +++ sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/package-info.java Tue Feb 17 10:32:22 2015 @@ -17,7 +17,7 @@ * under the License. */ -@Version("2.1") +@Version("2.1.1") package org.apache.sling.api.servlets; import aQute.bnd.annotation.Version;