yiguolei commented on code in PR #24297: URL: https://github.com/apache/doris/pull/24297#discussion_r1325231287
########## fe/fe-common/src/main/java/org/apache/doris/common/io/DeepCopy.java: ########## @@ -74,19 +72,17 @@ public static <T> T copy(Writable orig, Class<T> c, int metaVersion) { 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: and this line -- 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