Proposal: #ClassFileAccPublic
forax at univ-mlv.fr
forax at univ-mlv.fr
Mon Jul 11 22:07:45 UTC 2016
Hi Paul,
I don't think it's a good idea to mark exported or not exported types with a flag.
The level of a type is the wrong level, the package level has the advantage to be already used in the wild (what's why you have doc comments saying that you should not use com.sun.foo by example) and if each class can be marked exported or not, verifying that all types of a package are exported (or not) will be burdensome.
In a well defined component model, duplicating an information already available at an upper level at a lower level is a bad idea, because while it's true that the information may be more easily available, it makes the separate compilation a nightmare. With your proposal, each time i decide to export a package in the module-info, all the classes of that package must be recompiled.
regards,
Rémi
----- Mail original -----
> De: "Paul Benedict" <pbenedict at apache.org>
> À: "Java Platform Module System (JSR 376) Expert Group Observers"
> <jpms-spec-observers at openjdk.java.net>, forax at univ-mlv.fr
> Cc: "Mark Reinhold" <mark.reinhold at oracle.com>
> Envoyé: Lundi 11 Juillet 2016 22:28:55
> Objet: Re: Proposal: #ClassFileAccPublic
> Remi, perhaps my question should have been reversed. :-) What about retaining
> ACC_MODULE for types that are private to the module (i.e., they live in
> packages not exported)? The original use of it can still be retained.
> Cheers,
> Paul
> On Mon, Jul 11, 2016 at 3:10 PM, Paul Benedict < pbenedict at apache.org >
> wrote:
> > Remi, what do you think of preserving ACC_MODULE so that classes which are
> > exported are flagged with it? It would be an easy way for clients to
> > inspect
> > a type and see if a type was exported.
>
> > Cheers,
>
> > Paul
>
> > On Wed, Jul 6, 2016 at 11:23 AM, Remi Forax < forax at univ-mlv.fr > wrote:
>
> > > ACC_TRANSITIVE looks fine to me,
> >
>
> > > even if it really means transitive at one hop only.
> >
>
> > > Rémi
> >
>
> > > ----- Mail original -----
> >
>
> > > > De: "Mark Reinhold" < mark.reinhold at oracle.com >
> >
>
> > > > À: jpms-spec-experts at openjdk.java.net
> >
>
> > > > Envoyé: Mercredi 6 Juillet 2016 17:32:36
> >
>
> > > > Objet: Proposal: #ClassFileAccPublic
> >
>
> > > >
> >
>
> > > > Issue summary
> >
>
> > > > -------------
> >
>
> > > >
> >
>
> > > > #ClassFileAccPublic --- The `ACC_PUBLIC` constant in a `requires_flags`
> >
>
> > > > should be encoded as `0x0001`, as it is elsewhere in the JVMS, rather
> >
>
> > > > than as `0x0020`, which has different meanings in other contexts.
> >
>
> > > >
> >
>
> > > > Proposal
> >
>
> > > > --------
> >
>
> > > >
> >
>
> > > > Unlike the other `ACC_PUBLIC` constants, this constant does not express
> >
>
> > > > an access mode but, rather, the addition of an implied transitive
> >
>
> > > > readability edge from modules that depend upon this module to some
> > > > other
> >
>
> > > > module required by this module. To avoid confusion at the class-file
> >
>
> > > > level, rename this constant to `ACC_TRANSITIVE`.
> >
>
> > > >
> >
>
> > > > (Whether the syntax of module declarations should use a keyword other
> >
>
> > > > than `public` for this purpose would be a separate issue.)
> >
>
> > > >
> >
>
> > > >
> >
>
> > > > [1]
> > > > http://openjdk.java.net/projects/jigsaw/spec/issues/#ClassFileAccPublic
> >
>
> > > >
> >
>
More information about the jpms-spec-observers
mailing list