github-code-scanning[bot] commented on code in PR #14662:
URL: https://github.com/apache/druid/pull/14662#discussion_r1274205145


##########
server/src/main/java/org/apache/druid/client/indexing/ClientKillUnusedSegmentsTaskQuery.java:
##########
@@ -39,19 +41,23 @@
   private final String dataSource;
   private final Interval interval;
   private final Boolean markAsUnused;
+  @Nullable private final Integer maxSegmentsToKill;
 
   @JsonCreator
   public ClientKillUnusedSegmentsTaskQuery(
       @JsonProperty("id") String id,
       @JsonProperty("dataSource") String dataSource,
       @JsonProperty("interval") Interval interval,
-      @JsonProperty("markAsUnused") Boolean markAsUnused
+      @JsonProperty("markAsUnused") Boolean markAsUnused,
+      @JsonProperty("maxSegmentsToKill") Integer maxSegmentsToKill
   )
   {
     this.id = Preconditions.checkNotNull(id, "id");
     this.dataSource = dataSource;
     this.interval = interval;
     this.markAsUnused = markAsUnused;
+    Preconditions.checkArgument(maxSegmentsToKill > 0, "maxSegmentsToKill must 
be > 0");

Review Comment:
   ## Dereferenced variable may be null
   
   Variable [maxSegmentsToKill](1) may be null at this access because of 
[this](2) null argument.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/5293)



-- 
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]


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

Reply via email to