RFR: 8274809: Update java.base classes to use try-with-resources [v3]

Bradford Wetmore wetmore at openjdk.java.net
Wed Oct 6 19:56:08 UTC 2021


On Wed, 6 Oct 2021 18:47:26 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

>> 8274809: Update java.base classes to use try-with-resources
>
> Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8274809: Update java.base classes to use try-with-resources
>   update copyright year

src/java.base/share/classes/sun/net/NetProperties.java line 72:

> 70:             fname = f.getCanonicalPath();
> 71:             try (FileInputStream in = new FileInputStream(fname)) {
> 72:                 BufferedInputStream bin = new BufferedInputStream(in);

Shouldn't this have a multiple resource block in the try-with block here:  

    try (FileInputStream in = new FileInputStream(fname);
            BufferedInputStream bin = new BufferedInputStream(in)) {
        props.land(bin);
    }

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

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



More information about the security-dev mailing list