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 58360 - [41cat] Override Methods i wrong order
Summary: [41cat] Override Methods i wrong order
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: Other Linux
: P3 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-27 03:46 UTC by johnzoet
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description johnzoet 2005-04-27 03:46:09 UTC
[ BUILD # : RC1 ]
[ JDK VERSION : 1.5.0_02 ]

Code example: 
=> 
		SwingWorker swingWorker = new 
SwingWorker() { 
			 
			public void finished() { 
 
				
super.finished(); 
			} 
 
			public Object 
construct() { 
			} 
			 
		}; 
=> 
 
The Override MEthods diolog shows methods in 
this order: 
construct() 
finished() 
 
The actual order in the editor is the other way 
around. 
This is quite inconvenient as you want to code 
method construct() before method finished(). 
Also it is quite confusing as you expect the 
order in the editor to be the same as the order 
in the dialog.
Comment 1 Miloslav Metelka 2005-04-27 08:00:55 UTC
Reassigning to java module for evaluation.
Comment 2 Daniel Prusa 2005-09-07 10:30:21 UTC
Methods are sorted alphabetically in the Override Methods dialog, not by the
order in the source code, this is as designed. This ordering is better
especially in situations when there are more methods and the user is serching
for a particular method. Moreover, the displayed methods often reside in a
different source file than the one the Override Methods action is invoked on. In
such a case, the user usually does not have any expectations about the ordering
of the methods.

There could be possibly a switch in the dialog allowing to display the methods
in the source order, however this is an enhancement rather than a defect.
Comment 3 johnzoet 2005-09-07 10:40:06 UTC
I still feel it is confusing if the order of the methods generated in the source
differs from the order in the JavaDoc as shown in the editor dialog.
Comment 4 Daniel Prusa 2005-09-07 10:50:32 UTC
OK, maybe the solution could be as follows:
- the methods are displayed alphabetically in the dialog
- when a group of methods is selected to be overriden, they are generated in the
order that corresponds to the order in the source file the original methods
reside in
Comment 5 johnzoet 2005-09-07 11:06:44 UTC
I prefer to have the methods generated in the same order as in dialog "Override
and implement Methods".
This seems to me according to the principle of the least surprise.