Confusing error message for inner non-public service provider

Alex Buckley alex.buckley at oracle.com
Fri Feb 10 01:31:30 UTC 2017


// Rewording and resending to avoid confusion.

On 2/9/2017 4:21 PM, Jonathan Gibbons wrote:
> On 2/9/17 3:07 PM, Alex Buckley wrote:
>> All the JLS wants is for the class to be 'public'.
> Does that just apply locally to the declaration of the class itself, or
> does it also indirectly apply to any enclosing classes, in the case of a
> nested class?

Just the declaration of the class itself. The JLS does NOT want the 
specified class to be accessible from <some other class>. That is, the 
JLS does not care about a chain of access from <some other class> to the 
provider class, which might conceivably allow the provider class to have 
default (package) access. The JLS just wants the 'public' modifier on 
the class declaration, end of story.

Alex


More information about the jigsaw-dev mailing list