Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 74493 - Changing method signature to an existing one
Changing method signature to an existing one
Status: RESOLVED INVALID
Product: editor
Classification: Unclassified
Component: Refactoring
5.x
All All
: P3 (vote)
: TBD
Assigned To: Ralph Ruijs
issues@java
:
Depends on:
Blocks: 65780
  Show dependency treegraph
 
Reported: 2006-04-06 11:08 UTC by Tim Lebedkov
Modified: 2011-05-23 12:10 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Lebedkov 2006-04-06 11:08:45 UTC
For the following class:

class A {
 public A() {}
 public A(String txt) {}
}

changing the method signature from A(String) to A() is not possible 
because A() already exist. But it should be possible!
In this case the method A(String) should just be removed.

It is probably an enhancement.

Thank You
Comment 1 Ralph Ruijs 2011-05-23 12:10:12 UTC
IMO changing a method signature to an existing one should not be possible. A refactoring should not change the outcome of a program and creating a second method with the same signature makes the code invalid.

The proposed fix of deleting the second method is will almost certainly change the outcome of the program. If the desired result is to change all method calls from one method to another the following should be done instead:

1. change the method to delegate to the desired method (in this case A()).
2. inline the old method, therefore changing all the method calls to the delegated method.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo