empty catch blocks in the same line
I prefer to have all opening curly braces on a new line:
if (foo)
{
bar();
}
Can I configure the Eclipse code formatter to put empty catch blocks in the same line?
try
{
foo();
}
catch (ImpossibleCheckedException ignore) {}
I have already found the option to put the curly braces of an empty block on a single line (New Lines
, [ ] in empty block
), but not on the same line as the catch. And yes, I r开发者_如何学编程eally want that empty catch block.
Can't be done, at least the Eclipse formatter does not support this.
p.s. Due to the discussion on the other answers (which are now deleted), I feel obliged to stay on topic but add this comment: Empty catch blocks are bad m'kay Why are empty catch blocks a bad idea?
精彩评论