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 215674 - Refactoring "Change method parameters" does not find usages of removed parameter in overriding method
Summary: Refactoring "Change method parameters" does not find usages of removed parame...
Status: REOPENED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 10:04 UTC by Jachym_Vojtek
Modified: 2016-07-11 07:08 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 10:04:03 UTC
Consider following example:

public class Class0 {

    public void test(int i) {
    }
}

class Class1 extends Class0 {

    @Override
    public void test(int i) {
        System.out.println(i);
    }
}

When I perform refactoring "Change method parameters" and delete parameter "i" on Class0.test(int i) refactoring does not warn me that parameter "i" is used in method Class0.test(int i). 

If I perform the same refactoring on Class1 refactoring warns me 'Parameter "i" is used within method body. Do you really want to delete "i"?'

1) Would it be possible to find usages of parameter also in overriding method and warn user about parameter usages? 

2) It would be also great to highlight usages of variable "i" in refactoring preview. Currently  System.out.println(i) does not highlight "i".
Comment 1 Martin Balin 2015-09-17 11:16:13 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-18 06:09:14 UTC
Verified in Product Version: NetBeans IDE Dev (Build 201509150002).

Concerning the bug description, it should be:
When I perform refactoring "Change method parameters" and delete parameter "i" on Class0.test(int i) refactoring does not warn me that parameter "i" is used in method Class1.test(int i).

From my point of view the behaviour is even worse compared with NB 7.3.

If I perform remove parameter on Class1 refactoring does not even warn me 'Parameter "i" is used within method body. Do you really want to delete "i"?'
Comment 3 Martin Balin 2016-07-07 07:18:22 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 4 Jachym_Vojtek 2016-07-11 07:08:10 UTC
Checked in NetBeans IDE Dev (Build 201607110002).
Still needs to be fixed.