[NEW BUG] jdk.internal.module.Checks seems to miss a check for 'var'

Christoph Dreis christoph.dreis at freenet.de
Fri Mar 22 12:53:32 UTC 2019


Thanks Alan for your fast response.

I'm "glad" the root issue remains even though the initial patch is wrong.

I guess "uses" could be affected here as well, not just "mainClass" and "provides".
How do we move on from now? Can I help in anyway?

Christoph

> On 22/03/2019 11:30, Christoph Dreis wrote:
> > Hi,
> >
> > I recently stumbled upon jdk.internal.module.Checks and was wondering
> > if you could help me understanding if I face a bug. The mentioned
> > class has a private static field containing a list of reserved
> > keywords. When checking the list for completeness, I noticed that
> > "var" seems to be missing here and I wonder if it should be added.
> This class supports validation when building module descriptors with the API,
> e.g.
> 
>          var descriptor = ModuleDescriptor.newModule("var")
>                  .exports("var", Set.of("var"))
>                  .provides("var.var", List.of("var.var"))
>                  .mainClass("var.var")
>                  .build();
> 
> It is also used when deriving module descriptors for automatic modules.
> 
> So I think you found an issue as the "provides" and "mainClass" builder
> methods should reject a class name named "var" (no issue with the module
> or packages names which is why it shouldn't be added to the RESERVED set).
> 
> -Alan



More information about the core-libs-dev mailing list