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 252645 - Step-down Rule
Summary: Step-down Rule
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-28 11:38 UTC by mau-ss
Modified: 2015-06-10 08:40 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mau-ss 2015-05-28 11:38:15 UTC
It would be great if there would be a feature to organize the methods of a class, following the configuration specified by Editor->Formatting->Java->Code Generation, using the Step-down Rule and not the alphabetic order like today.

The Clean Code Method Sorter conceived by Robert C. Martin proposes to improve the readability of your source code following the newspaper metaphor:

A class should be readable like a newspaper, starting with the most important methods, followed by methods which are invoked later in the execution flow.
Comment 1 mau-ss 2015-06-05 11:43:03 UTC
I got a example from Greenkeeper's wiki:

Example sort by newspaper

Before sort:
<code>
void MethodD()
{ 
}

void MethodB()
{ 
}

void MethodA()
{
  MethodB()
  MethodC()
}

void MethodC()
{ 
   MethodD()
}
</code>

After sort by newspaper:

<code>
void MethodA()
{
  MethodB()
  MethodC()
}

void MethodB()
{ 
}

void MethodC()
{ 
   MethodD()
}

void MethodD()
{ 
}
</code>