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 74493 - Changing method signature to an existing one
Summary: Changing method signature to an existing one
Status: RESOLVED INVALID
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks: 65780
  Show dependency tree
 
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
Exception Reporter:


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.