weiwei121723 commented on code in PR #2161:
URL: https://github.com/apache/kylin/pull/2161#discussion_r1430942237


##########
src/common-server/src/main/java/org/apache/kylin/rest/controller/NEpochController.java:
##########
@@ -48,7 +51,11 @@ public class NEpochController extends NBasicController {
     @PostMapping(value = "", produces = { HTTP_VND_APACHE_KYLIN_JSON, 
HTTP_VND_APACHE_KYLIN_V4_PUBLIC_JSON })
     @ResponseBody
     public EnvelopeResponse<String> updateEpochOwner(@RequestBody EpochRequest 
epochRequest) {
-        checkCollectionRequiredArg("projects", epochRequest.getProjects());
+        if (Objects.isNull(epochRequest.getProjects())) {
+            // Avoid following NPEs.
+            epochRequest.setProjects(new ArrayList<>(0));
+        }
+        // Empty projects has specified meanings: all projects do change epoch.

Review Comment:
   我主要担心这个接口,忘记传projects参数,不小心更新了所有的epoch。如果为空或者emptyList,应该直接报错比较稳妥些;
   感觉/api/epoch/all 更适合做这个事情



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@kylin.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to