FuzzingTeam commented on code in PR #5065:
URL: https://github.com/apache/hadoop/pull/5065#discussion_r1002703817


##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/erasurecode/TestCoderBase.java:
##########
@@ -224,13 +225,25 @@ protected ECChunk[] backupAndEraseChunks(ECChunk[] 
dataChunks,
     int idx = 0;
 
     for (int i = 0; i < erasedDataIndexes.length; i++) {
-      toEraseChunks[idx ++] = dataChunks[erasedDataIndexes[i]];
-      dataChunks[erasedDataIndexes[i]] = null;
+      if (erasedDataIndexes[i] < dataChunks.length) {
+        toEraseChunks[idx ++] = dataChunks[erasedDataIndexes[i]];
+        dataChunks[erasedDataIndexes[i]] = null;
+      } else {
+        throw new HadoopIllegalArgumentException(

Review Comment:
   @steveloughran, sorry I don't quite understand this. Is this also a public 
API? I found that this is only being used in Test classes. 
   I have changed the exception type to IllegalArgumentException.



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