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.
I have a problem with the option "Show non-public members" on the navigator window of NetBeans 6.9. The problem is that I can see all members (public and non-public), but when I disable the option, to see only public members, nothing appears in the navigator window. Product Version: NetBeans IDE 6.9 Beta (Build 201004212000) Java: 1.6.0_18; Java HotSpot(TM) Client VM 16.0-b13 System: Windows XP version 5.1 running on x86; Cp1252; pt_BR (nb)
P.S: I also have this problem with NetBeans 6.8
Works for me. Can you attach an example file. Thanks Peter, can you verify it? Thanks
Created attachment 99505 [details] navigator working as expected
Created attachment 99506 [details] navigator working as expected
Created attachment 99507 [details] other class
Created attachment 99508 [details] other class: bug
It seems the problem is happening for some specific classes... I have attached 4 screenshots to this bug. The first and second screenshots show the navigator working as expected, for the same class. The third and fourth screenshots show the navigator when I am editing other class. In the fourth screenshot you can see that nothing is appearing at the navigator. Note the 'Show non-public members' option, selected and not selected.
As I can see now, this is not really a bug... It is because my class is not a 'public class'. It is a 'final class'. Maybe in the future NetBeans should provide a "show not private members" option...
I agree that even when the class is non public the class should be shown. Changing to enhancement
7.1 continues with this issue. Product Version: NetBeans IDE Dev (Build 201110110600) Java: 1.6.0_27; Java HotSpot(TM) Client VM 20.2-b06 System: Windows 7 version 6.1 running on x86; Cp1252; en_BR (nb)
In short (to remember): when a class is not public and the option "Show non-public members" of the navigator window is not selected, nothing is displayed in the navigator window. Product Version: NetBeans IDE Dev 7.1 (Build 201110110600) Java: 1.6.0_27; Java HotSpot(TM) Client VM 20.2-b06 System: Windows 7 version 6.1 running on x86; Cp1252; en_BR (nb)
IMO this is a bug. Whether members are public doesn't have anything to do with whether the class is public or not.
Still present in NetBeans 7.2.1. Example code: class Test { public void test() { } } when a class is not public and the option "Show non-public members" is unselected in the navigator window, nothing is displayed in the navigator window. I think public attributes and methods should be displayed even if the class is not public.
It's questionable. In your example: class Test { public void test() { } } The method should not be probably shown as the API client has no way how to access it, the type is not exported. However if I modify the example to: class Test { public String toString() { return ""; } } it probably should be shown as it's a part of the publicly accessible API overridden from j.l.Object.
ceklock, please be so kind and do not change product/component/keywords/type, .... or explain why did you do so. Thanks for understanding.
(In reply to comment #14) > It's questionable. > In your example: > > class Test { > > public void test() { > } > } > > The method should not be probably shown as the API client has no way how to > access it, the type is not exported. If you take the class itself as an (mini-)API, the respective member is public in this class API, in the sense of being part of the API. Whether this class API is exposed publicly or just within its package is a separate question; usually the design of the class's API shouldn't be affected by it. My point is this: Even if a class is package-private, it is still designed to provide/fullfill a specific contract towards its client code. "Show non-public members" is a useful switch to toggle between viewing all members and viewing just the members of the class's API towards its client code. With the current behavior, this switch becomes useless for package-private classes although it would be very useful for viewing the class's API towards its clients (which just happen to be limited to classes in the same package).
matthies: this is exactly what I was trying to say. The class is viewable in the package, but I can't view the public members because the class is not public.
OK, I will ask UI and change if they agree.
(In reply to comment #16) > "Show non-public > members" is a useful switch to toggle between viewing all members and viewing > just the members of the class's API towards its client code. IMHO the above sentence from Comment #16 summarizes the core of the problem the best. The discussion is about two sides of the coin - on one hand we can follow the purist approach (as it is implemented now) and effectively render the "Show non-public members" filter unusable for non public classes, or on the other hand we can accept the view that the switch should have just local meaning regardless the global publicity of the class itself, and should just make it possible to "to toggle between viewing all members and viewing just the members of the class's API towards its client code". It seems to me that global visibility of the class as a whole is not of importance here and now (at development stage), as it may change anyway. I can imagine working on a public class which I later decide to make package-private or vice versa, while regardless of that I would still think about some if its members as public and about others as non-public, and would want to use the switch. The mere fact that till now it has been effectively disabled for certain classes while actually it does have well-defined behavior in context of all classes feels like we are facing here a unnecessary restriction (which does not seem to help in any promotion of good coding practice or any other such concern). Thus I vote in favor of following the other side of the coin and to implement the change in "Show non-public members" behavior.
In reply to comment #19: >Thus I vote in favor of following the other side of the coin and to implement the >change in "Show non-public members" behaviour. OK, I will do it.
Also yesterday I've implemented different file icons for java file types (class, interface, annotation, enum). I've looked at Idea and found that they display files with API exported classes (public) with green lock. This is nice unfortunately we already have 4 badges on file nodes and there is no place for the next one. Maybe we should reconsider importance of these 4 badges.
Fixed jet-main c29b9c9baffd
Integrated into 'main-silver', will be available in build *201407170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/c29b9c9baffd User: Tomas Zezula <tzezula@netbeans.org> Log: #186670: Show non-public top level classes