eolivelli commented on code in PR #3914:
URL: https://github.com/apache/bookkeeper/pull/3914#discussion_r1187868995


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/server/http/service/TriggerGCService.java:
##########
@@ -69,8 +69,15 @@ public HttpServiceResponse handle(HttpServiceRequest 
request) throws Exception {
             } else {
                 @SuppressWarnings("unchecked")
                 Map<String, Object> configMap = JsonUtil.fromJson(requestBody, 
HashMap.class);
-                Boolean forceMajor = (Boolean) 
configMap.getOrDefault("forceMajor", null);
-                Boolean forceMinor = (Boolean) 
configMap.getOrDefault("forceMinor", null);
+                Object forceMajorObj = configMap.getOrDefault("forceMajor", 
null);
+                Object forceMinorObj = configMap.getOrDefault("forceMinor", 
null);
+                boolean forceMajor = false, forceMinor = false;
+                if (forceMajorObj instanceof Boolean) {
+                    forceMajor = (Boolean) forceMajorObj;

Review Comment:
   We should throw an error if it is not a boolean, otherwise the result is 
unpredictable 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to