On formatting my code Ctrl + Shift + f This is how my code looks
if (item == null) {}
Is it possible to get it formatted like
if(item == null) {}
Thanks,
You can go to Window > Preferences > Java > Code Style > formatter > Edit > and uncheck option "before opening parenthesis".

You can configure formatting profiles on Eclipse.
Just go to Eclipse preferences > Java > Code Style > Formatter.
As the other answer specifies (damn it, that was fast!) you'll find the particular option you're looking for on the before opening parenthesis checkbox displayed when selecting control statements > 'if else' on the white space tab on the edit profile dialog.
Check out these resources too:
http://www.ralfebert.de/archive/java/source_formatting/
Best Eclipse Code Formatters?
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