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 124213 - Navigator doesn't show public members of non-public classes
Summary: Navigator doesn't show public members of non-public classes
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker with 2 votes (vote)
Assignee: Petr Hrebejk
Depends on:
Reported: 2007-12-18 18:47 UTC by matthies
Modified: 2008-02-28 15:33 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description matthies 2007-12-18 18:47:17 UTC
In the Navigator window for a package-private class, when "Show non-public members" is turned off, no members at all 
are displayed (the window is empty). This is wrong, the access level of the class ought to be irrelevant here.
Comment 1 Jan Becicka 2008-01-31 10:13:15 UTC
Well, you cannot access any member from different package...
Comment 2 matthies 2008-01-31 11:10:00 UTC
It depends. When the package-private class implements a public interface, then the corresponding public members 
constitute a public API in a very real sense. Furthermore, and this is my actual concern, when choosing to make a class 
package-private, because it is only used within the respective package, one usually still defines its API as if it 
where a public class, that is one distinguishes properly between public and private members (and possibly protected 

I'd like to use the Navigator to see at a glance what the public API of a class is (as opposed to implementation 
details), even if the API happens to be accessible only to others classes of the same package. Even between classes of 
the same package, there is a distinction between hidden implementation details of a class and its actual API towards 
the other classes. It's still as much an API as with public classes.
Comment 3 Jan Becicka 2008-02-28 10:55:58 UTC
This issue is about personal preference. If I turn off "show non-public members" I expect, that I will see only public
members. And package private class is really not public. I understand your use case, but we cannot do both things.
Changing to enhancement.
Comment 4 matthies 2008-02-28 15:33:00 UTC
Hmm. In my opinion this isn't just personal preference. The members are declared with the 'public' keyword, and they 
*are* public relative to the class (= published/exported by the class), even if the class is not public relative to the 
package (= not published/exported by the package). These are two different scopes. And the Navigator is about the class 
level, not about the package level. (I know how the Java Reflection API behaves, which is probably the reason for the 
current state, but that's beside the point.) The flag is currently simply useless for non-public classes, because there 
it basically just means "(don't) show anything". Not even public members inherited from public classes are shown.