Eclipse formatter settings for the Builder pattern Eclipse formatter settings for the Builder pattern java java

Eclipse formatter settings for the Builder pattern


Turning off formatting with comments, or inserting line comments is too tedious.

The best way is described here:

... or you can select "Line Wrapping > Never join already wrapped lines" globally. Then, you can break it manually and the formatter will only format inside lines (or add additional line breaks if necessary).

With this setting Eclipse formatter will stop ruining your builder statements.

enter image description here


Use comments:

   Object o = foo() //      .bar() //      .toString();


In Eclipse 3.6 It's possible to turn off formatting for a region of code. See my answer to

How to turn off the Eclipse code formatter for certain sections of Java code?