| Summary: | [inline] refactoring produces different result depending on whether declaration is inlined or the invocation | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Deepak Azad <deepakazad> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, kenneth |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
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. Still an issue in 4.11 M3. Tested with 2019-06_M1+ and could not reproduce (In reply to Kenneth Styrberg from comment #3) > Tested with 2019-06_M1+ and could not reproduce Indeed. Not sure what I did. |
3.7 M5 --------------------------------------------------- package argument_in; public class TestArray { public int bar(int a[]) { //2 return a[0]; } public void main() { int i= bar(new int[] {1}); //1 } } --------------------------------------------------- 1. Inline the method invocation 'bar' => int i= (new int[] {1})[0]; => Good. 2. Inline the method declaration 'bar' => int i= ((int[]) new int[] {1})[0]; => Bad There is an unnecessary cast, plus the result is different in both cases.