HADOOP-18505. Handled ArrayIndexOutOfBoundsException in TestCoderBase#5065
HADOOP-18505. Handled ArrayIndexOutOfBoundsException in TestCoderBase#5065teamconfx wants to merge 3 commits into
Conversation
|
🎊 +1 overall
This message was automatically generated. |
| if (inputs.length != decoder.getNumParityUnits() + | ||
| decoder.getNumDataUnits()) { | ||
| throw new IllegalArgumentException("Invalid inputs length"); | ||
| throw new HadoopIllegalArgumentException("Invalid inputs length"); |
There was a problem hiding this comment.
implicit changes in public api; revert
There was a problem hiding this comment.
Thanks @steveloughran for the review. I have reverted the change.
| toEraseChunks[idx ++] = dataChunks[erasedDataIndexes[i]]; | ||
| dataChunks[erasedDataIndexes[i]] = null; | ||
| } else { | ||
| throw new HadoopIllegalArgumentException( |
There was a problem hiding this 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.
|
|
||
| // decode | ||
| backupAndEraseChunks(clonedDataChunks, parityChunks); | ||
| try { |
There was a problem hiding this comment.
use LambdaTestUtils.intercept() for all bits of test code which validates expected exceptions
There was a problem hiding this comment.
The backupAndEraseChunks method would only throw exception if the erased data index is out of bound. This is only true for the newly added value set.
Adding LambdaTestUtils.intercept() fails the tests for other parameterized values since LambdaTestUtils.intercept() @throws AssertionError if the evaluation call didn't raise an exception.
|
🎊 +1 overall
This message was automatically generated. |
|
We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
Description of PR
JIRA: HADOOP-18505
How was this patch tested?
Added a new value set and consequently modified the existing unit tests
testValidateandtestValidateWithBadDecodingof test classTestDecodingValidatorto verify the code change.For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?