Hi Jörg

On 08.01.2003 16:38:04 J.Pietschmann wrote:
> Jeremias Maerki wrote:
> > I've got the same problem with that. I've found more than a few
> > occurences of that last example in FOP. It would be nice to restrict
> > that rule to one line ifs/fors/whiles. Having more than one line in
> > total should mean having to use braces.
> I don't understand this: It has different semantics.

I'll try...

This should be detected and barked at:

    for (int i = 0; i < 5; i++) {
        doSomething();
        if (amIRight())
            cool();
            doSomethingElse();
    }
    
reason: wrong indentation

...and this, too:

    for (int i = 0; i < 5; i++) {
        doSomething();
        if (amIRight())
            cool();
        doSomethingElse();
    }

reason: if spread over more than one line without braces.

The following should (sorry, could) be ok:

    for (int i = 0; i < 5; i++) {
        doSomething();
        if (amIRight()) cool();
        doSomethingElse();
    }


> > Or if checkstyle could also check indentation...
> That's Jalopy or Emacs reindent for you.

If only everybody would run the formatter...We're facing reality here.
:-)


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to