CalvinKirs commented on code in PR #24297:
URL: https://github.com/apache/doris/pull/24297#discussion_r1325246361


##########
fe/fe-common/src/main/java/org/apache/doris/common/io/DeepCopy.java:
##########
@@ -44,18 +44,16 @@ public static boolean copy(Writable orig, Writable dest, 
Class c, int metaVersio
         metaContext.setMetaVersion(metaVersion);
         metaContext.setThreadLocalInfo();
 
-        FastByteArrayOutputStream byteArrayOutputStream = new 
FastByteArrayOutputStream();
-        DataOutputStream out = new DataOutputStream(byteArrayOutputStream);
-        try {
+        try (FastByteArrayOutputStream byteArrayOutputStream = new 
FastByteArrayOutputStream();
+                DataOutputStream out = new 
DataOutputStream(byteArrayOutputStream)) {
             orig.write(out);
             out.flush();
             out.close();

Review Comment:
   don't need to explicitly invoke 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: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to