Bug 400181 - formatter: Keep 'break' or 'continue' clause on one line
Summary: formatter: Keep 'break' or 'continue' clause on one line
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-07 03:29 EST by Sebastian Dietrich CLA
Modified: 2013-02-12 09:05 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Dietrich CLA 2013-02-07 03:29:23 EST
In Formatter / Control Statements / 'if else' I can select to keep return or throw clause on one line, but not to keep break or continue clause on one line.

e.g. the following (desired) format:

if (a==1) return;
if (a==2) throw new IllegalArgumentException();
if (a==3) break;
if (a==4) continue;

is currently formatted as:

if (a==1) return;
if (a==2) throw new IllegalArgumentException();
if (a==3) {
  break;
}
if (a==4) {
  continue;
}

which does not look good.

-> please provide a "Keep 'break' or 'continue' clause on one line" checkbox in Formatter / Control Statements / 'if else'
Comment 1 Jay Arthanareeswaran CLA 2013-02-12 09:05:58 EST
I agree it would be nice to have this fixed. But this is not something we can commit to work on at this point. You are welcome to post a patch, though.