| Summary: | [extract method] wrong return type when extracting code from a cycle | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | kuba <kuba.v> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | amj87.iitr, deepakazad, kuba.v |
| Version: | 3.5.2 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Moving to JDT/UI for comment. This works with 3.6, can you please try with that. *** This bug has been marked as a duplicate of bug 213519 *** |
Build Identifier: 20090920-1017 In the following snippet extracting the marked code (the body of the second cycle) would lead to: extracted(multiple3, j); instead of multiple3 = extracted(multiple3, j); There is no warning shown, but it changes the result! --------------- code snippet ----------------- String multiple3 = ""; System.out.println("Searching numbers: "); //this for cycle has to be here! If commented it works fine. for (int t = 1; t < 20; t++) { System.out.print(t + ", "); } for (int j = 1; j < 20 ; j++) { //try to extract following 4 lines to a method if (j % 3 == 0) { multiple3 = multiple3 + j + ", "; } System.out.println(multiple3); } Reproducible: Always