| Summary: | Moving a method changes the program behavior | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Melina Mongiovi <melmongiovi> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 4.5 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | stalebug | ||
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
Reproducing the bug: Consider the following program: package test1; public class Test1 { public void methodToMove(){} private TestTarget target; public TestTarget getTestTarget(){ return target; } } package test1; public class TestTarget { } package test2; import test1.Test1; public class Test2 { public Test2(){ new Test1().methodToMove(); } } Now, let's move method Test1.methodToMove to TestTarget Resulting program: package test1; public class Test1 { public TestTarget target; public TestTarget getTestTarget(){ return target; } } package test1; public class TestTarget { public void methodToMove(){} } package test2; import test1.Test1; public class Test2 { public Test2(){ new Test1().target.methodToMove(); } } This transformations changes the program behavior. Notice that, only in the resulting program, the Test2 constructor throws a Null Pointer.