lifepuzzlefun commented on code in PR #4021:
URL: https://github.com/apache/bookkeeper/pull/4021#discussion_r1285379241
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BufferedChannel.java:
##########
@@ -243,6 +243,11 @@ public long forceWrite(boolean forceMetadata) throws
IOException {
@Override
public synchronized int read(ByteBuf dest, long pos, int length) throws
IOException {
+ // protect negative position read
+ if (pos < 0) {
+ throw new IllegalArgumentException("Negative position pos:" + pos);
Review Comment:
Thanks for review. my concern on using IOException is that current code base
seems not process IOException directly. I didn't check what will happen if the
IOException throws outside. For this case I think the
`IllegalArgumentException` is the same as origin behaviour as this is the same
exception throw by jdk.
--
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]