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 215679 - Refactoring "Change method Parameter" does not consider existing local variables in overriding methods
Summary: Refactoring "Change method Parameter" does not consider existing local variab...
Status: REOPENED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 11:51 UTC by Jachym_Vojtek
Modified: 2015-09-17 11:46 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 Jachym_Vojtek 2012-07-18 11:51:52 UTC
Example:

public class Class0 {    

    public void test(int i) {           
    }
}

class Class1 extends Class0 {

    @Override
    public void test(int i) {
        int x;        
    }
}

When you try to add parameter named "x" using refactoring on method Class1.test(int i) refactoring warns you 'Name "x" is already used as name of local variable'.
But when you try to do the same (adding x parameter) on Class0.test(int i) refactoring is performed and as a result you get:

class Class1 extends Class0 {

    @Override
    public void test(int i, Object x) {
        int x;        
    }
}
with duplicated variable "x"
Comment 1 Martin Balin 2015-09-17 11:16:12 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.
Comment 2 Jachym_Vojtek 2015-09-17 11:46:34 UTC
This is simply reproducible in NetBeans IDE Dev (Build 201509150002).
Well, I guess that closing bugs which remain untouched (regrettably) for 3 years is a common practice of the development process.
But from my point of view, I can think that it is waste of my time (in fact the waste of time of our company) to report bugs on NB.