in eclipse menu-->Windows-->preferences, search for the formatter, then edit then set the checkbox: insert space before opening brace


in eclipse menu-->Windows-->preferences, search for the formatter, then edit then set the checkbox: insert space before opening brace


Default code style will add space where you want it, and it can be autoformatted on every save:
Window->Preferences->Java->Editor->SaveActions: check "Format source code"
In case you want to change some of the default styles, you can do so if you navigate to formatter and edit active profile there:

Formatting Code
Eclipse Java code style formatter - Stack Overflow
In Eclipse, what plugin/class provides the style formatting on Java code? - Stack Overflow
java - Best Eclipse Code Formatters? - Stack Overflow
Have a look at Window>Preferences>Java>Code Style>Formatter.
There you can configure almost everything. Your case is found at
Line Wrapping>Method Declarations>Parameters.
In my version of Eclipse, I found the option under Window->Preferences->Java->Code Style->Formatter, then clicked the Edit.. button.
In the new window, go to the Line Wrapping tab and find Method Declarations. You want to change the Line wrapping policy. The Force split check box seems to do the same.
How to change the formatting of Eclipse IDE code to match the IntelliJ IDE format?
For example, the formatting of Streams in Eclipse bothers me, and I'd like to make it the same as IntelliJ's.
My laptop is too weak to download IntelliJ.
Select "Peferences" from the Eclipse menu. Go to Java -> Code Style -> Formatter
Preferences can be set at project level.
Incase you are planning on writing your own formatting code, then take a look at "workspace mechanics" plugin.
This functionality is part of the JDT project (Java Developer Tools). The actual code sits in org.eclipse.jdt.core (non-UI parts) and org.eclipse.jdt.ui (UI parts).
The viewer stuff is mostly in the UI plugin (sources). It's hard to give any more specifics as highlighting includes custom viewer, parser, extension mechanisms (for 3rd party plugins)
I would highly recommend the google's style guide, it's a collection of coding style guide for commonly used programming languages.
The eclipse configurable Java guide can be found here. Installing the guide is quite simple, Save the style xml to a file and import it using the following dialogue box:
Window -> Preferences -> Java -> Code Style -> Formatter
Finally select the active profile as GoogleStyle.
I always change the formatter in Eclipse to Java Convention AND change the tab policy to always use space instead of tab or mixing of tab and space. Sometime I change also the line width to be 100 or 120 (80 characters is just too narrow in my monitor).
Regarding your specific request: yes you can change this behavior. Go to the Formatter preference and create your own profile. Modify it on tab Line Wrapping and uncheck Prefer wrapping outer expressions (keep nested expression on one line).
More information on: https://bugs.eclipse.org/bugs/show_bug.cgi?id=313524
