ClassLoader.definePackage() throwing IllegalArgumentException

2025-05-19 Thread Robert Stupp
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

Re: RFR: 8349545: ClassLoader.definePackage() throws IllegalArgumentException if package already defined [v2]

2025-03-24 Thread Robert Stupp
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

Re: RFR: 8349545: ClassLoader.definePackage() throws IllegalArgumentException if package already defined [v2]

2025-03-24 Thread Robert Stupp
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

Re: RFR: 8349545: ClassLoader.definePackage() throws IllegalArgumentException if package already defined

2025-02-23 Thread Robert Stupp
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

RFR: 8349545: ClassLoader.definePackage() throws IllegalArgumentException if package already defined

2025-02-23 Thread Robert Stupp
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