Bug 259064 - [quick assist] convert for-loop to while (and back)
Summary: [quick assist] convert for-loop to while (and back)
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-17 03:26 EST by Thorbjørn Ravn Andersen CLA
Modified: 2008-12-17 04:27 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thorbjørn Ravn Andersen CLA 2008-12-17 03:26:01 EST
Build ID: jdt:  M20080709-0800 (myeclipse 7.0)

Steps To Reproduce:
1. enter "for(int i = 0; i < 10; i++) {System.out.println(i);}"
2. place cursor on "for"
3. quickfix should suggest "refactor to int i=0; while(i<10) {System.out.println(i); i++;}"


More information:
the structure "for(a; b; c) {d}" should be changed to
"a; while(b) {d; c}" and reformatted.
Comment 1 Thorbjørn Ravn Andersen CLA 2008-12-17 04:27:50 EST
I don't believe that "and back" is an option, as you would need to indicate what a and c would be in order to do this accurately.

Converting a "while (b) {d}" to "for(;b;) {d}" should be easy though :)