RFR 8246337: Add more JVM tests for sealed classes
Lois Foltan
lois.foltan at oracle.com
Thu Jun 25 16:42:39 UTC 2020
On 6/22/2020 9:06 AM, Harold Seigel wrote:
> Hi,
>
> Please review this change to add more JVM tests for sealed classes.
> With this change there are now the following set of tests for both
> sealed classes and sealed interfaces.
>
> 1. Successful tests when both the subclass and its sealed super type
> are in the same module and package and subclass is listed on its
> sealed type's permits list.
> 2. Successful tests when both the subclass and its sealed super type
> are in the same module, different package, and the subclass is open
> and is listed on its sealed type's permits list.
> 3. Error tests for when the subclass and its sealed super type are in
> different modules and the subclass is listed on its sealed type's
> permits list.
> 4. Error tests for when the subclass and its sealed super type are in
> the same module, but different packages, and the subclass is not
> open and the subclass is listed on its sealed type's permit list.
> 5. Error tests for when the subclass and its sealed super type are in
> the same module and package but the subclass is not listed on its
> sealed type's permits list.
>
> Open Webrev:
> http://cr.openjdk.java.net/~hseigel/bug_8246337/webrev/index.html
>
> JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8246337
>
> The new and modified tests were tested on Linux-x64, Linux-aarch64,
> Windows, and Mac OS X using Mach5.
>
> Thanks, Harold
>
>
Hi Harold,
Good additions to the testing for covering different/same module &
packages. I would have liked to seen 2 other tests
- differing class loaders for a subclass and its sealed super type in
the unnamed module/unnamed package situation.
I assume the test should fail due to differing unnamed modules for
each class loader
- also, a nestmates test. One where the non-public subclass and its
sealed super type are in the same module & package but the super type is
not in the same nest as the subclass.
Again, I assume the test should fail.
I'm ok if you want to open a separate RFE for these 2 other tests.
Thanks,
Lois
More information about the hotspot-runtime-dev
mailing list