You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/09/02 06:32:03 UTC

[GitHub] [inlong] thesumery commented on a diff in pull request #5768: [INLONG-5767][Sort] Fix IOUtils interface is incompatible in jdk17

thesumery commented on code in PR #5768:
URL: https://github.com/apache/inlong/pull/5768#discussion_r961332472


##########
inlong-sort/sort-end-to-end-tests/src/test/java/org/apache/inlong/sort/tests/utils/FlinkContainerTestEnv.java:
##########
@@ -293,8 +294,11 @@ private String constructDistJar(Path... jars) throws IOException {
             for (Path jar : jars) {
                 try (InputStream is = new FileInputStream(jar.toFile())) {
                     jos.putNextEntry(new JarEntry("lib/" + jar.getFileName().toString()));
-                    jos.write(IOUtils.readNBytes(is, is.available()));
+                    jos.write(IOUtils.toByteArray(is));
+                    is.close();

Review Comment:
   is.close() is useless , try with resource will auto close it.



-- 
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-unsubscribe@inlong.apache.org

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