This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 255787 - Exporting non-public type hint looks incorrect in some cases
Summary: Exporting non-public type hint looks incorrect in some cases
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-07 20:17 UTC by Michel Graciano
Modified: 2015-10-08 12:50 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample project (14.11 KB, application/zip)
2015-10-07 20:17 UTC, Michel Graciano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2015-10-07 20:17:51 UTC
Created attachment 156606 [details]
Sample project

Exporting non-public type hint looks incorrect in some cases. In my case, I have an implicitly public interface (with no modifier), and created a class like this:

public class PublicApi<T extends SampleInterface> {}

Now I have the hint warning me about non-public API been exposed. In fact, according to JSL, all members of interfaces lacking access modifiers are implicitly public. So my understanding here is that I am exposing a public API and the hint should not be shown IMO.

I am attaching a sample project.
Comment 1 Ralph Ruijs 2015-10-08 12:50:35 UTC
(In reply to Michel Graciano from comment #0)
> Now I have the hint warning me about non-public API been exposed. In fact,
> according to JSL, all members of interfaces lacking access modifiers are
> implicitly public. So my understanding here is that I am exposing a public
> API and the hint should not be shown IMO.

From the JLS: "Every method declaration in the body of an interface is implicitly public (ยง6.6).". This rule doesn't apply to the interface itself, which can still be "package private".