Withdrawn: 8349545: ClassLoader.definePackage() throws IllegalArgumentException if package already defined
duke
duke at openjdk.org
Mon May 19 16:15:59 UTC 2025
On Sun, 23 Feb 2025 11:32:41 GMT, Robert Stupp <rstupp at openjdk.org> wrote:
> Concurent calls to `ClassLoader.definePackage()` can yield `IllegalArgumentException`s if the package is already defined. Some built-in class loaders, like `URLClassLoader`, already handle this case, but custom class loaders (would) have to handle this case.
>
> This change updates the logic of `CL.definePackage` to not throw an IAE if the "redefined" package is equal to the already defined one.
>
> Tests added in `jdk/java/lang/Package/PackageDefineTest.java` (+ pulling up the `TestClassLoader` from `PackageDefineTest`).
This pull request has been closed without being integrated.
-------------
PR: https://git.openjdk.org/jdk/pull/23737
More information about the core-libs-dev
mailing list