dweiss commented on code in PR #12977:
URL: https://github.com/apache/lucene/pull/12977#discussion_r1441428909


##########
lucene/misc/src/java/org/apache/lucene/misc/index/IndexSplitter.java:
##########
@@ -67,18 +66,10 @@ public static void main(String[] args) throws Exception {
     if (args[1].equals("-l")) {
       is.listSegments();
     } else if (args[1].equals("-d")) {
-      List<String> segs = new ArrayList<>();
-      for (int x = 2; x < args.length; x++) {
-        segs.add(args[x]);
-      }
-      is.remove(segs.toArray(new String[0]));
+      is.remove(Arrays.copyOfRange(args, 2, args.length));

Review Comment:
   This passes validation checks only because the method is suppressed from 
checks - it uses the sysouts. Arrays.copyOfRange is on the forbidden APIs list, 
it should be replaced with:
   
   java.util.Arrays#copyOfRange(**) @ Prefer using ArrayUtil as 
Arrays#copyOfRange fills zeros for bad bounds
   
   



-- 
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...@lucene.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to