wenbingshen commented on code in PR #4021:
URL: https://github.com/apache/bookkeeper/pull/4021#discussion_r1281358080
##########
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:
`IllegalArgumentException` is an unchecked exception, can we use
`IOException` and catch it in the program?
--
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]