saxenapranav commented on code in PR #6699:
URL: https://github.com/apache/hadoop/pull/6699#discussion_r1578942351
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemAuthorization.java:
##########
@@ -328,13 +328,13 @@ private void executeOp(Path reqPath, AzureBlobFileSystem
fs,
fs.open(reqPath);
break;
case Open:
- InputStream is = fs.open(reqPath);
- if (getConfiguration().getHeadOptimizationForInputStream()) {
- try {
- is.read();
- } catch (IOException ex) {
- is.close();
- throw (IOException) ex.getCause();
+ try(InputStream is = fs.open(reqPath)) {
+ if (getConfiguration().isInputStreamLazyOptimizationEnabled()) {
+ try {
+ is.read();
+ } catch (IOException ex) {
+ throw (IOException) ex.getCause();
+ }
Review Comment:
inputStream is opened with try-with-resources statement, at the end of the
block, inputStream would be closed (even in exception raise).
--
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]