spec clarification: empty default view
Alex Buckley
alex.buckley at oracle.com
Mon Jan 23 18:15:22 PST 2012
On 1/23/2012 5:57 PM, Jonathan Gibbons wrote:
> In a ModuleProvides_attribute, does there have to be an entry for the
> default view, even it it would be completely empty?
Attributes should only store what exists. The language and the module
system might well say there is logically a default view which is empty,
but we traditionally don't "do" dummy attributes with zero-length tables
in the ClassFile. (A ClassFile format checker must be able to handle
them, but a Java compiler is not obligated to produce it.)
So, if a module declaration consists of just 'requires' clauses and
exports nothing, has no aliases, no friends, and no entrypoint, then I
would say no ModuleProvides attribute is needed at all.
Adding one non-default view to that module declaration would prompt a
ModuleProvides attribute, but I don't think a default view needs to
spring into the physical representation too. Each physical view is
standalone in ModuleProvides.
Alex
More information about the jigsaw-dev
mailing list