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 126934 - request for automatic refactoring of method signatures via suggestion
Summary: request for automatic refactoring of method signatures via suggestion
Status: RESOLVED DUPLICATE of bug 157497
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 6.x
Hardware: All Windows XP x64
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-07 17:13 UTC by softwarevisualization
Modified: 2011-07-11 08:25 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 softwarevisualization 2008-02-07 17:13:18 UTC
A method defined to take a certain set of parameters (a method signature) exists in a class thus:

private foo(int x, Integer y);

The method is invoked within the class by a particular line of code thus:

foo(1, myNumber);


as a result of refactoring (say change method signature) or for any number of other reasons, the type of the parameter
myNumber changes, say from Integer to Float, thus breaking the method invocation of method foo(int, Integer). 

foo(1,myInteger) <--- this is now an error- method signature mismatch, expected Integer, found Float.

REQUESTED ENHANCEMENT:
Let a suggestion (light bulb icon) appear asking if the method signature should be changed to match the invocation.
Answering affirmatively results in the signature of foo(int , Integer) being changed to foo(int, Float).

RATIONALE:
This permits a natural flow of work, starting from a  "change method parameters" and driving the consequences of that
change forward throughout the application. As it stand now, netbeans simply reports that it "cannot find method foo". It
neither offers to create such a method (a less desirable response) nor offers to reconcile the method with the new
invocation (the appropriate response).
 
That is experienced as less than optional. The result of changing a method parameter shouldn't be the editor no longer
recognizes what it recognized just a second ago- that the invocation to method foo is, very likely, still an invocation
to method foo. It is possible and desirable for the mismatch between invocation and signature to be reconciled by the
editor. 


thank you for reading this.
Comment 1 Ralph Ruijs 2011-07-11 08:25:59 UTC

*** This bug has been marked as a duplicate of bug 157497 ***