RFR: 8080272 Refactor I/O stream copying to use java.io.InputStream.transferTo [v8]
    Alan Bateman 
    alanb at openjdk.java.net
       
    Mon Feb  8 14:06:55 UTC 2021
    
    
  
On Mon, 21 Dec 2020 09:16:11 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:
>> 8080272  Refactor I/O stream copying to use java.io.InputStream.transferTo
>
> 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 in Apache Santuario
src/java.management/share/classes/javax/management/loading/MLet.java line 1147:
> 1145:                                       .toFile();
> 1146:                      file.deleteOnExit();
> 1147:                      Files.copy(is, file.toPath());
One thing to check here is the existing behavior when the file already exists (as Files.copy will fail if the file exists, need to specify REPLACE_EXISTING to get the semantics of the existing code).
The code that follows checks if the file exists, this will always be true when Files.copy succeeds.
src/java.base/share/classes/sun/net/www/MimeLauncher.java line 2:
> 1: /*
> 2:  * Copyright (c) 1994, 2020, Oracle and/or its affiliates. All rights reserved.
Is MimeEntry.launch still used? I'm wondering if the MimeLauncher can be deleted.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1853
    
    
More information about the net-dev
mailing list