ined in a different way tailored
for today's needs and wishes? And are there any that would justify such
an effort?
Overall, I'm a bit lost on what the "best" way would be for this. Maybe
the answer is that there is no better way yet, which is also fine. Maybe
the only "fix" is to enhance the Javadocs and prominently highlight the
behavior and add a "reference code snippet" how 'definePackage()' should
be used and why.
Robert
--
Robert Stupp
@snazy
On Mon, 24 Mar 2025 07:53:26 GMT, Robert Stupp 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
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`).
Robert S
On Sun, 23 Feb 2025 11:32:41 GMT, Robert Stupp 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 lo
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