Bug 44757 - New code formatter does not format switch statements correctly
Summary: New code formatter does not format switch statements correctly
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-13 10:30 EDT by Joseph Cavanaugh CLA
Modified: 2003-11-17 18:31 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 Joseph Cavanaugh CLA 2003-10-13 10:30:17 EDT
The new code formatter seems to be only indenting the first line and the break 
line correctly.  Here is what the formatter is producing:

switch (VARIABLE)
{
    case CASE_1 :
        _foo= false;
    doSomething1();
    doSomething2();
    doSomething3();
        break;

    case CASE_2 :
        _foo= true;
    doSomething4();
        break;
}

build: 3.0m4
<from prefs_store.ini in jdt.core>
org.eclipse.jdt.core.codeComplete.fieldPrefixes=_
org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled
org.eclipse.jdt.core.formatter.newline.openingBrace=insert
org.eclipse.jdt.core.formatter.space.castexpression=do not insert
org.eclipse.jdt.core.formatter.style.assignment=compact
org.eclipse.jdt.core.formatter.tabulation.char=space
Comment 1 Olivier Thomann CLA 2003-10-16 08:47:52 EDT
Reproduced. I am working on it.
Comment 2 Olivier Thomann CLA 2003-10-16 10:51:53 EDT
Fixed and released in HEAD.
Regression tests added.