anshuksi282-ksolves commented on PR #8622: URL: https://github.com/apache/hadoop/pull/8622#issuecomment-5190311928
Hi @pan3793, Thank you for the detailed and insightful review! I have pushed a new commit addressing all your findings: 1. Removed the dead if (bufSize < 0) and if (checksumBufSize < 0) branches, as Math.multiplyExact handles the overflow by throwing an ArithmeticException. 2. Reverted the checksum buffer initialization back to the simple new byte[getChecksumSize() * BUFFER_NUM_CHUNKS] one-liner, since getChecksumSize() will never be large enough to overflow. 3. Updated resetChecksumBufSize() to use Math.multiplyExact for consistency with the constructor and to guard against any latent overflow issues. 4. Regarding the exception type, I've left it as IllegalArgumentException for now as you noted it's just informational, but please let me know if you'd prefer me to switch it to HadoopIllegalArgumentException. Please let me know if everything looks good now! -- 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]
