RFR: 8080272 Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy [v10]

Alan Bateman alanb at openjdk.java.net
Mon Feb 15 19:25:42 UTC 2021


On Mon, 15 Feb 2021 18:33:00 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

>> 8080272  Refactor I/O stream copying to use InputStream.transferTo/readAllBytes and Files.copy
>
> Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8080272: Refactor I/O stream copying to use java.io.InputStream.transferTo
>   revert changes from MimeLauncher

src/java.management/share/classes/javax/management/loading/MLet.java line 1149:

> 1147:                      file.deleteOnExit();
> 1148:                      Files.copy(is, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
> 1149:                      if (file.exists()) {

You might have missed the comment from a previous iteration. The files.exists() check goes away when Files.copy succeeds.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1853


More information about the security-dev mailing list