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

fjy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 54a7b54  avoid 'must return non-void type' warning (#8105)
54a7b54 is described below

commit 54a7b54d2d0faa147060d879200453de54e7539d
Author: Himanshu <[email protected]>
AuthorDate: Thu Jul 18 15:02:27 2019 -0700

    avoid 'must return non-void type' warning (#8105)
---
 .../apache/druid/indexing/worker/http/TaskManagementResource.java | 6 ++++--
 .../java/org/apache/druid/server/http/SegmentListerResource.java  | 8 +++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git 
a/indexing-service/src/main/java/org/apache/druid/indexing/worker/http/TaskManagementResource.java
 
b/indexing-service/src/main/java/org/apache/druid/indexing/worker/http/TaskManagementResource.java
index 85f6610..7b4b2b3 100644
--- 
a/indexing-service/src/main/java/org/apache/druid/indexing/worker/http/TaskManagementResource.java
+++ 
b/indexing-service/src/main/java/org/apache/druid/indexing/worker/http/TaskManagementResource.java
@@ -100,11 +100,12 @@ public class TaskManagementResource
    * @param hash hash received in last response.
    * @param timeout after which response is sent even if there are no new 
segment updates.
    * @param req
+   * @return null to avoid "MUST return a non-void type" warning.
    * @throws IOException
    */
   @GET
   @Produces({MediaType.APPLICATION_JSON, 
SmileMediaTypes.APPLICATION_JACKSON_SMILE})
-  public void getWorkerState(
+  public Void getWorkerState(
       @QueryParam("counter") long counter,
       @QueryParam("hash") long hash,
       @QueryParam("timeout") long timeout,
@@ -113,7 +114,7 @@ public class TaskManagementResource
   {
     if (timeout <= 0) {
       sendErrorResponse(req, HttpServletResponse.SC_BAD_REQUEST, "timeout must 
be positive.");
-      return;
+      return null;
     }
 
     final ResponseContext context = createContext(req.getHeader("Accept"));
@@ -195,6 +196,7 @@ public class TaskManagementResource
     );
 
     asyncContext.setTimeout(timeout);
+    return null;
   }
 
   @POST
diff --git 
a/server/src/main/java/org/apache/druid/server/http/SegmentListerResource.java 
b/server/src/main/java/org/apache/druid/server/http/SegmentListerResource.java
index 3a531b7..73900de 100644
--- 
a/server/src/main/java/org/apache/druid/server/http/SegmentListerResource.java
+++ 
b/server/src/main/java/org/apache/druid/server/http/SegmentListerResource.java
@@ -108,12 +108,13 @@ public class SegmentListerResource
    * @param hash hash received in last response.
    * @param timeout after which response is sent even if there are no new 
segment updates.
    * @param req
+   * @return null to avoid "MUST return a non-void type" warning.
    * @throws IOException
    */
   @GET
   @Produces({MediaType.APPLICATION_JSON, 
SmileMediaTypes.APPLICATION_JACKSON_SMILE})
   @Consumes({MediaType.APPLICATION_JSON, 
SmileMediaTypes.APPLICATION_JACKSON_SMILE})
-  public void getSegments(
+  public Void getSegments(
       @QueryParam("counter") long counter,
       @QueryParam("hash") long hash,
       @QueryParam("timeout") long timeout,
@@ -122,12 +123,12 @@ public class SegmentListerResource
   {
     if (announcer == null) {
       sendErrorResponse(req, HttpServletResponse.SC_NOT_FOUND, "announcer is 
not available.");
-      return;
+      return null;
     }
 
     if (timeout <= 0) {
       sendErrorResponse(req, HttpServletResponse.SC_BAD_REQUEST, "timeout must 
be positive.");
-      return;
+      return null;
     }
 
     final ResponseContext context = createContext(req.getHeader("Accept"));
@@ -208,6 +209,7 @@ public class SegmentListerResource
     );
 
     asyncContext.setTimeout(timeout);
+    return null;
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to