Integrated: 8264048: Fix caching in Jar URL connections when an entry is missing
Aleksei Efimov
aefimov at openjdk.java.net
Tue Apr 6 10:47:31 UTC 2021
On Tue, 30 Mar 2021 11:30:48 GMT, Aleksei Efimov <aefimov at openjdk.org> wrote:
> Current fix tries to tackle an issue with URL connection referencing non-existing Jar file entries:
> If an entry that doesn't exist is specified in an URL connection the underlying Jar file is still cached even if an exception is thrown after that. Such behavior prevents the caller, for instance, a `URLClassLoader`, from closing a Jar file.
>
> The proposed fix checks if entry exists before caching a Jar file (only for cases with enabled caching):
> - If entry exists - jar file is cached if it wasn't cached before
> - If entry doesn't exist and jar file wasn't cached before - jar file is closed and exception is thrown
> - If entry doesn't exist and jar file was cached before - jar file is kept cached and exception is thrown
>
>
> The following tests have been used to verify the fix:
> - New regression tests
> - ``:jdk_core:`` tests
> - `api/java_util`,`api/java_net` JCK tests
This pull request has now been integrated.
Changeset: a611c462
Author: Aleksei Efimov <aefimov at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/a611c462
Stats: 372 lines in 6 files changed: 346 ins; 2 del; 24 mod
8264048: Fix caching in Jar URL connections when an entry is missing
Co-authored-by: Daniel Fuchs <dfuchs at openjdk.org>
Reviewed-by: bchristi, dfuchs
-------------
PR: https://git.openjdk.java.net/jdk/pull/3263
More information about the core-libs-dev
mailing list