Bug 128818 - [quick assist] Change 'else' to block moves 'else' into comment
Summary: [quick assist] Change 'else' to block moves 'else' into comment
Status: RESOLVED DUPLICATE of bug 95839
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-21 10:40 EST by Danny Yates CLA
Modified: 2006-03-07 12:26 EST (History)
1 user (show)

See Also:


Attachments
File which causes problems (33.84 KB, text/plain)
2006-02-21 10:45 EST, Danny Yates CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Danny Yates CLA 2006-02-21 10:40:08 EST
In the attached file (which, according to the comments, is public domain), doing a code-clean up with all options disabled except "Use Blocks", "Always" results in an uncompilable CU. The error is introduced on line 799 of the cleaned-up code.
Comment 1 Olivier Thomann CLA 2006-02-21 10:43:42 EST
Move to JDT/UI
Comment 2 Danny Yates CLA 2006-02-21 10:45:10 EST
Created attachment 35075 [details]
File which causes problems
Comment 3 Danny Yates CLA 2006-02-21 10:48:09 EST
Also, line 922
Comment 4 Benno Baumgartner CLA 2006-02-21 11:16:22 EST
I20060217-1115

Given:
if (true) {
}//
else 
    System.out.println(b);

1. Place cursor on 'else' keyword
2. Ctrl-1
3. Change else to block

is:
if (true) {
}// else {
    System.out.println(b);
}

expected (i.e.):
if (true) {
}// 
else {
    System.out.println(b);
}

It may be a dup of bug 128422
Comment 5 Danny Yates CLA 2006-02-21 11:19:12 EST
Another possible answer is:

if (true) {
} else {
    //
    System.out.println(b);
}
Comment 6 Martin Aeschlimann CLA 2006-03-07 12:26:17 EST

*** This bug has been marked as a duplicate of 95839 ***