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 251519 - Patch for: Organize Members - ignore ordering of fields
Summary: Patch for: Organize Members - ignore ordering of fields
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2015-03-30 22:11 UTC by markiewb
Modified: 2015-07-04 03:13 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed patch (13.10 KB, patch)
2015-03-30 22:17 UTC, markiewb
Details | Diff
Patch in action (93.21 KB, image/png)
2015-03-30 22:17 UTC, markiewb
Details
Arrange settings in IDEA 12 (55.11 KB, image/png)
2015-04-07 20:13 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2015-03-30 22:11:25 UTC
Follow up the https://netbeans.org/bugzilla/show_bug.cgi?id=249199

In #249199 an option "Sort using dependencies" has been introduced. But this does not fulfill my original request [1]

EXPECTED: Support ordering of members, but without sorting the fields.

[1] https://netbeans.org/bugzilla/show_bug.cgi?id=249199#c15
Comment 1 markiewb 2015-03-30 22:17:13 UTC
Created attachment 152936 [details]
Proposed patch

@Svata: Please review the patch and apply it. See the 3 lines at GeneratorUtils:336. I am not sure, if these changes are enough, but it seems to work for me. 

See also the screenshot in the next comment
Comment 2 markiewb 2015-03-30 22:17:39 UTC
Created attachment 152937 [details]
Patch in action
Comment 3 Svata Dedic 2015-04-07 12:04:16 UTC
1/ the 'uses dependencies' applies also to visibility sort (perhaps should to all of them); the indent is misleading IMHO.

2/ similar to fields, other coding conventions may disable method ;) or type ordering. Would it be possible to cover all those cases - without eating additional screen estate ?
Comment 4 markiewb 2015-04-07 20:13:28 UTC
Created attachment 153085 [details]
Arrange settings in IDEA 12

(In reply to Svata Dedic from comment #3)
> 1/ the 'uses dependencies' applies also to visibility sort (perhaps should
> to all of them); the indent is misleading IMHO.

Such an UI change is easy, if you want me to.

> 2/ similar to fields, other coding conventions may disable method ;) or type
> ordering. 

> Would it be possible to cover all those cases - without eating additional screen estate ?

I guess not. See the options dialog for that in IDEA in the attachment. Everything is configurable, but it is (too) overwhelming.

@Svata: So what do you want me to do?
Comment 5 Svata Dedic 2015-04-13 10:23:15 UTC
Well; I would not like to add another option 'just' for a special purpose -- the other day some other user will come with a (valid) enhancement that methods (or other stuff) should be excluded from the ordering or grouping ... so if a change is made, it should cover some aspect completely.
Comment 6 markiewb 2015-04-13 18:00:40 UTC
(In reply to Svata Dedic from comment #5)
> Well; I would not like to add another option 'just' for a special purpose --
> the other day some other user will come with a (valid) enhancement that
> methods (or other stuff) should be excluded from the ordering or grouping
> ... so if a change is made, it should cover some aspect completely.

So there is no chance to get it integrated somehow? Not even by a specific cmdline-switch for netbeans.conf? Or some renaming?

IMHO it is better to deliver a feature (even it is imperfect) for users/customers than to wait for a perfect solution, which covers every case, but will delivered in 5 years or never. But Svata, your opinion is also valid.
Comment 7 _ gtzabari 2015-07-04 03:13:50 UTC
Svata,

I am strongly against the recent addition of "Sort uses dependencies" because disabling it results in Netbeans producing non-compiling code. As far as I'm aware, no one is asking for this functionality and it is harmful to support.

Markie wanted an option which would reduce the number of lines that code-format modifies (quoting him: "to keep the diff as small as possible"). So let's either add that option or not, but either way please remove "Sort uses dependencies".

Thank you and sorry for the rant :)