RFR: 8298875: A module requiring "java.base" with flags ACC_SYNTHETIC should be rejected

Jaikiran Pai jpai at openjdk.org
Tue Dec 20 15:25:51 UTC 2022


On Fri, 16 Dec 2022 19:30:24 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> A small oversight with ModuleDescriptor.read when checking the requires table of a Module attribute. The requires entry for java.base should not have ACC_SYNTHETIC set.
> 
> A new test is added. Some of the existing tests used `@Test(expectedExceptions=...)`. I've changed some of these to use assertThrows to narrow it down to method that is expected to throw.

Marked as reviewed by jpai (Reviewer).

I don't have previous knowledge of this area, but reading the JBS issue and the JVM spec section 4.7.25 https://docs.oracle.com/javase/specs/jvms/se19/html/jvms-4.html#jvms-4.7.25, this change looks fine to me. The test changes too look good.

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

PR: https://git.openjdk.org/jdk/pull/11714


More information about the core-libs-dev mailing list