History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-19321
Type: Bug Bug
Status: Open Open
Assignee: Olesya Smirnova
Reporter: Christian Nelson
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

Incorrect formatting with "Simple blocks on one line" and "Force braces"

Created: 26 Aug 08 03:54   Updated: 26 Aug 08 21:30
Component/s: Code Formatting and Code Style

File Attachments: 1. Zip Archive code-formatting-bug.zip (8 kb)

Image Attachments:

1. actual-formatting.jpg
(51 kb)

2. expected-formatting.jpg
(50 kb)
Environment: Windows XP

Build: 7,941
Severity: Medium


 Description  « Hide
If/else statements are not formatted correctly when both "Simple blocks on one line" and "Force braces" code style options are enabled.

Expected code formatting:

if (x > 0) { System.out.println("one"); }
else if (y > 1) { System.out.println("two"); }

Actual formatting:

if (x > 0)
{ System.out.println("one"); }
else if (y > 1) { System.out.println("two"); }

Note: If statements (with no else clause) format almost as expected (see related issue IDEA-19328).

Attached project includes a single class with a main method and the code style is captured in the ipr.

Applies to both v7.0.4 and v8.0M1.



 All   Comments   Work Log   Change History      Sort Order:
Jon Steelman - 26 Aug 08 19:09
I also don't see any instance of the rule "Simple blocks on one line" applied in the Preview code in the right pane in build #8733. Shouldn't each control be reflected in the preview code so you can see how it applies?

Thanks,
Jon