| Summary: | [change method signature] NPE while renaming a method | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Frederic Fusier <frederic_fusier> | ||||||
| Component: | UI | Assignee: | Markus Keller <markus.kell.r> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | adam.hawthorne, daniel_megert, deepakazad, markus.kell.r, raksha.vasisht | ||||||
| Version: | 3.4.2 | Flags: | raksha.vasisht:
review+
|
||||||
| Target Milestone: | 3.7.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Frederic Fusier
I can easily reproduce it with the following simple test case:
Test.java:
public class Test {
void foo() {}
}
Ref.java:
public class Ref {
void bar(Test test) {
test.foo();
}
}
Select foo in test.foo() and click on the menu item:
Refactor... -> Change Method Signature...
Then in the 'Change Method Signature' dialog, change only the name of the method (e.g. foo2), click OK => boom NPE!
Happens only when "Keep original method as delegate to changed method" is checked but "Mark as deprecated" is unchecked.
Pasteable snippet:
package test;
public class Test {
void foo() {}
}
package test;
public class Ref {
void bar(Test test) {
test.foo();
}
}
Already happens in 3.4.2, probably even earlier. Tentatively targetting 3.7.1.
Workaround is to toggle either of the checkboxes in the dialog.
Created attachment 198748 [details]
Fix
Needs a regression test.
*** Bug 240048 has been marked as a duplicate of this bug. *** Created attachment 201814 [details]
Fix & test
Fixed in HEAD. Raksha, please review for R3_7_maintenance. (In reply to comment #6) > Fixed in HEAD. Raksha, please review for R3_7_maintenance. Looks good to me. Thanks, committed to R3_7_maintenance. Verified in M20110824-0800 on Linux. |