You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2019/07/09 13:52:56 UTC

[sling-whiteboard] 01/02: Avoid warnings

This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit cac4496d5e49d6e6123e7b8ad78655614303ba7d
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Tue Jul 9 15:46:14 2019 +0200

    Avoid warnings
---
 .../main/java/org/apache/sling/graalvm/http/SlingResource.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/graalvm/src/main/java/org/apache/sling/graalvm/http/SlingResource.java b/graalvm/src/main/java/org/apache/sling/graalvm/http/SlingResource.java
index 6d97215..523df5d 100644
--- a/graalvm/src/main/java/org/apache/sling/graalvm/http/SlingResource.java
+++ b/graalvm/src/main/java/org/apache/sling/graalvm/http/SlingResource.java
@@ -25,7 +25,13 @@ public class SlingResource {
     @Context
     private HttpServletRequest request;
 
-    @GET
+    static class HttpResponse extends MockSlingHttpServletResponse {
+        @Override
+        public void setContentLength(int length) {
+        }
+    }
+
+     @GET
     public Response sling(@PathParam("resourcePath") String resourcePath) throws IOException {
         final SlingRequestProcessor p = SlingContext.get().getService(SlingRequestProcessor.class);
         assert (p != null);
@@ -33,7 +39,7 @@ public class SlingResource {
         assert (resolver != null);
 
         try {
-            p.processRequest(request, new MockSlingHttpServletResponse(), resolver);
+            p.processRequest(request, new HttpResponse(), resolver);
         } catch (Exception e) {
             throw new RuntimeException(e);
         }