Bug 164947 - Spaces in control statements
Summary: Spaces in control statements
Status: RESOLVED DUPLICATE of bug 164946
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-17 06:25 EST by Marvin Fröhlich CLA
Modified: 2006-11-17 07:53 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marvin Fröhlich CLA 2006-11-17 06:25:41 EST
hi

First let me thank you for all the great work on the Eclipse code formatter. It
is a really great tool. But it lacks some important possibilities.

I use to format return- and throw-statements like this:

public MyClass getMyObject()
{
    MyClass o = new MyClass();

    doSomehting( 1 );

    if (somethingBad)
        throw( new IllegalBlaException( "bad bla" ) );

    return( o );
}

If I ran my formatter over this code, it would produce the following:

public MyClass getMyObject()
{
    MyClass o = new MyClass();

    doSomething( 1 );

    if (somethingBad)
        throw (new IllegalBlaException( "bad bla" ));

    return(o);
}

See the missing spaces between the opening brance and the closing brace of the
throw- and return-statement and the mistakenly added space after the throw
statement.

The code formatter doesn't support this formatting. I know, that not too many
people do it like that, but I find it just logic. I guess (or hope) it is not a
too big task to improve the formatter to also support this formatting. Could
you maybe do that? It would also be cool, if one could configure the formatter
to add these braces, if they're missing.

Marvin
Comment 1 Olivier Thomann CLA 2006-11-17 07:53:00 EST

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