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 74565 - Ctrl+I (implement methods) reverts method order
Summary: Ctrl+I (implement methods) reverts method order
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-07 09:19 UTC by randahl
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 randahl 2006-04-07 09:19:34 UTC
When using the Ctrl+I Implement Methods dialog and choosing "Show abstract
methods only" and then selecting a couple of methods to implement, netbeans adds
these methods to the current source file in reverse order. Example:

I have an abstract super class containing two methods
	public abstract List<V> getSelectedValues();
	public abstract void removeDeletedValues(List<V> deletedValues);

These methods are listed in this order because they are invoked in this order -
first the getSelectedValues method is invoked and then removeDeletedValues is
invoked. However, when implementing these methods using Ctrl+I you get the
following source code:
	public void removeDeletedValues(List<V> deletedValues) {
	}
	public List<V> getSelectedValues() {
	}

You might argue that the code above is still correct code, but I will argue that
it is less readable. If your abstract base class has several methods, ordering
them in a logical manner becomes crucial and therefore NetBeans should not
tamper with the order specified by the developer.

Yours
Randahl
Comment 1 Daniel Prusa 2006-05-10 16:03:37 UTC
Fixed in trunk.

/cvs/java/src/org/netbeans/modules/java/tools/JMIInheritanceSupport.java
new revision: 1.20; previous revision: 1.19
/cvs/java/src/org/netbeans/modules/java/tools/OverrideAction.java
new revision: 1.34; previous revision: 1.33
/cvs/java/src/org/netbeans/modules/java/tools/OverridePanel2.java
new revision: 1.12; previous revision: 1.11