You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/05/13 06:48:04 UTC

[GitHub] [iotdb] SpriCoder commented on a diff in pull request #5867: [IOTDB-3175] Unable to find file when creating user with AuthorInfo

SpriCoder commented on code in PR #5867:
URL: https://github.com/apache/iotdb/pull/5867#discussion_r872053038


##########
node-commons/src/main/java/org/apache/iotdb/commons/auth/role/LocalFileRoleAccessor.java:
##########
@@ -84,10 +84,9 @@ public Role loadRole(String rolename) throws IOException {
         return null;
       }
     }
-
-    try (FileInputStream inputStream = new FileInputStream(roleProfile);
-        DataInputStream dataInputStream =
-            new DataInputStream(new BufferedInputStream(inputStream))) {
+    FileInputStream inputStream = new FileInputStream(roleProfile);

Review Comment:
   Because FileInputStream will be closed at the same time when dataInputStream close.



##########
node-commons/src/main/java/org/apache/iotdb/commons/auth/user/LocalFileUserAccessor.java:
##########
@@ -98,9 +98,9 @@ public User loadUser(String username) throws IOException {
         return null;
       }
     }
-    try (FileInputStream inputStream = new FileInputStream(userProfile);
-        DataInputStream dataInputStream =
-            new DataInputStream(new BufferedInputStream(inputStream))) {
+    FileInputStream inputStream = new FileInputStream(userProfile);

Review Comment:
   Because FileInputStream will be closed at the same time when dataInputStream 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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org