I'm trying to set up Eclipse so that it formats a try catch finally block (when pressing CTRL+SHIFT+F
as follows:
try
{
// some code
}
catch (IOException exception)
{
// some exception handling code
}
finally
{
// some more code
}
I found the formatting options under Window >> Preferences >> Java >> Code Style >> Formatter and added a new Active profile, however I can't see an option for try catch blocks on the braces tab. I've set everything on that tab to "Next line", however the code now formats as:
try
{
// some code
} catch (IOException exception)
{
// some exception handling code
} finally
{
// some more code
}
The settings you need are in the Control Statements
tab:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With