Bug 502843 - [filters] Add "Hide java.lang.Object Methods" to Quick Outline
Summary: [filters] Add "Hide java.lang.Object Methods" to Quick Outline
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.7 M3   Edit
Assignee: Björn Michael CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-30 06:33 EDT by Björn Michael CLA
Modified: 2016-12-14 03:12 EST (History)
3 users (show)

See Also:
noopur_gupta: review-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Michael CLA 2016-09-30 06:33:35 EDT
It would be useful for the Quick Outline in show inherited members state to support a "Hide java.lang.Object Methods" filter. Everybody knows that classes / interfaces inherit from java.lang.Object. 13 methods like clone(), registerNatives etc. are shown that are in the majority of cases (95%+) irrelevant. So just filter them out to restore clarity and compactness.
Comment 1 Eclipse Genie CLA 2016-09-30 10:25:03 EDT
New Gerrit change created: https://git.eclipse.org/r/82253
Comment 2 Noopur Gupta CLA 2016-10-17 07:10:53 EDT
Review comments:

- Open the .class file for java.lang.Object. In the Quick outline menu, enable "Go Into Top Level Type". Enable the new Object members filter. 
Issue => The outline view is blank.

- The default constructor need not be declared explicitly in JavaLangObjectMembersFilter.

- JavaLangObjectMembersFilter.select(..) - why is the switch statement required? It has just one case with no default and also the filter is for all Object members.

- Similar to other existing filter descriptions, the filter description should not end with a full stop.
Comment 3 Noopur Gupta CLA 2016-10-17 07:16:57 EDT
(In reply to Noopur Gupta from comment #2)
> Review comments:
> 
> - Open the .class file for java.lang.Object. In the Quick outline menu,
> enable "Go Into Top Level Type". Enable the new Object members filter. 
> Issue => The outline view is blank.

Issue => The quick outline is blank (not the Outline view).
Comment 4 Eclipse Genie CLA 2016-10-17 16:47:35 EDT
New Gerrit change created: https://git.eclipse.org/r/83391
Comment 5 Björn Michael CLA 2016-10-17 16:55:55 EDT
(In reply to Noopur Gupta from comment #2)
> Review comments:
> 
> - Open the .class file for java.lang.Object. In the Quick outline menu,
> enable "Go Into Top Level Type". Enable the new Object members filter. 
> Issue => The outline view is blank.
Fixed.

> - The default constructor need not be declared explicitly in
> JavaLangObjectMembersFilter.
Primary for debugging purposes and javadoc (possibility to set breakpoint within ctor)

> - JavaLangObjectMembersFilter.select(..) - why is the switch statement
> required? It has just one case with no default and also the filter is for
> all Object members.
I was uncertain if fields should be added too. Now fields are also checked, maybe in future jdk versions fields will be added.

> - Similar to other existing filter descriptions, the filter description
> should not end with a full stop.
The description blueprint was the synthetic members filter that contains two full stops. But I remove the stop as proposed. Filter was renamed to 'Inherited java.lang.Object members' to reflect filter is disabled in java.lang.Object itself.
Comment 7 Noopur Gupta CLA 2016-10-18 09:22:41 EDT
Thanks for the updated patch. I have committed your changes here:

http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=3b491df298b5165b6c53658b6c31e9f24ba36b2c

I have also applied some additional changes:

- Renamed the filter to "Inherited members from java.lang.Object".
- Removed the default constructor keeping it consistent with existing filters. The reference to the instantiation by org.eclipse.jdt.ui.javaElementFilters extension can be found by searching for references to the filter class.
- Removed the switch statement (as any future initializer, nested class etc. from Object should also be filtered here).

http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=f6f54ef58c57738a8b725ebfebf12a8a1bdef855
Comment 8 Björn Michael CLA 2016-10-18 16:57:22 EDT
Great and thank you!
Comment 9 Dani Megert CLA 2016-12-12 11:49:19 EST
When providing a new feature it is expected to look over the whole IDE and provide a complete fix. Only adding the filter for Quick Outline is not enough. All views that show members should get that filter.

Please open a new bug report for the missing pieces (Outline and Members view), add the bug to this one and close it again. Then, please provide Gerrit changes for the missing work. Thanks.
Comment 10 Dani Megert CLA 2016-12-13 03:12:49 EST
(In reply to Dani Megert from comment #9)
> When providing a new feature it is expected to look over the whole IDE and
> provide a complete fix. Only adding the filter for Quick Outline is not
> enough. All views that show members should get that filter.
> 
> Please open a new bug report for the missing pieces (Outline and Members
> view), add the bug to this one and close it again. Then, please provide
> Gerrit changes for the missing work. Thanks.

Sorry for that noise, I forgot that we don't offer to show inherited members in the Outline (see bug 8625) and the Members (bug 46447) view.
Comment 11 Noopur Gupta CLA 2016-12-13 06:50:11 EST
Dani, you moved this bug to JDT Text and the assignee also got reset. Shouldn't it be assigned to JDT UI itself?
Comment 12 Björn Michael CLA 2016-12-13 08:48:11 EST
(In reply to Dani Megert from comment #10)
> Sorry for that noise, I forgot that we don't offer to show inherited members
> in the Outline (see bug 8625) and the Members (bug 46447) view.

No problem.
Another view with inherited fields and methods is "Type Hierarchy" view with "Show All Inherited Members" enabled, but this view doesn't support filtering.
So Quick Outline is the only applicable view I found so far.
Comment 13 Dani Megert CLA 2016-12-13 09:21:19 EST
(In reply to Noopur Gupta from comment #11)
> Dani, you moved this bug to JDT Text and the assignee also got reset.

Second thing was a mistake done by our Greasemonkey script, which rests to default.


> Shouldn't it be assigned to JDT UI itself?

No. The Quick Outline belongs to the editor which is JDT Text.