Summary: | do <single-statement> while(<condition>) is ill-formatted | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Rafael Chaves <eclipse> |
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.0 | ||
Target Milestone: | 3.2 M2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Rafael Chaves
2004-02-17 14:29:51 EST
Should be easy to fix. Fixed and released in HEAD. Regression test added. Verified for 3.0 using build I200403250010. In fact the fix was wrong. If the option to insert a new line before the while is off, then the formatting was ok. However we can decide that when there is only one statement that is not a block, the while should be on a new line. When only one statement is the do statement action and this statement is not a block, the most natural formatting is: class Foo { void m1() { int x; do x = 1; while (true); } } This is also do for a try statement. Fixed and resolved in HEAD. Updated org.eclipse.jdt.core.tests.formatter.FormatterRegressionTests.test119. Change in org.eclipse.jdt.internal.formatter.CodeFormatterVisitor.visit(DoStatement,BlockScope) Verified in I20050920-0010 for 3.2M2 |