eolivelli commented on code in PR #4340:
URL: https://github.com/apache/bookkeeper/pull/4340#discussion_r1590536703
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/JournalChannel.java:
##########
@@ -299,6 +298,8 @@ int read(ByteBuffer dst)
public void close() throws IOException {
if (bc != null) {
bc.close();
+ } else if (fc != null) {
Review Comment:
I would remove "else" and handle the 2 variables indipendenly
also we should try to close both of them in spite of any errors
```
try {
if (bc != null) {
bc.close();
}
} finally {
if (fc != null) {
fc.close();
}
}
```
--
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]