RFR: 8263412: ClassFileInstaller can't be used by classes outside of default package

Coleen Phillimore coleenp at openjdk.java.net
Thu Mar 11 21:18:11 UTC 2021


On Thu, 11 Mar 2021 05:47:00 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:

> Hi all,
> 
> could you please review the patch which moves `ClassFileInstaller` class to `jdk.test.lib.helpers` package? 
> to reduce changes in the tests, `ClassFileInstaller` in the default package is kept w/ just `main` method that calls  `jdk.test.lib.helpers. ClassFileInstaller::main`. 
> 
> from JBS:
>> ClassFileInstaller is in the default package hence it's impossible to use it directly by classes in any other package. although ClassFileInstaller is mainly used directly from jtreg test description, there are cases when one needs to use it in another "driver" class (e.g. to reduce boilerplate), yet to do. that these driver classes have to either be in a default package or use reflection, both approaches have drawbacks. 
>> 
>> to solve that, we can move ClassFileInstaller implementation to a package, and to avoid unneeded churn, keep package-less ClassFileInstaller class which will call package-full impl.
>>
>> the need for this patch has raised as part of [JDK-8254129](https://bugs.openjdk.java.net/browse/JDK-8254129).
> 
> testing:
> - [x] `:jdk_core` against `{macos,windows,linux}-x64`
> - [x] `:jdk_svc` against `{macos,windows,linux}-x64`
> - [x] `test/hotspot/jtreg` w/o `applications` and `vmTestbase` directories against `{macos,windows,linux}-x64`
> 
> Thanks,
> -- Igor

Looks good.  I looked at the RedefineClasses tests also.

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

Marked as reviewed by coleenp (Reviewer).

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


More information about the hotspot-runtime-dev mailing list