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: [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]