Eclipse Java EE IDE for Web Developers.
Version: Mars.2 Release (4.5.2)
Build id: 20160218-0600
Eclipse formatting code does not work for source code containing the following case:
String foo = (bar!=null)? value1 :
value2;
System.out.println("hello world");
the value1 and value2 can be very long, so split into two lines.
Java editor: format the code above (CTRL + I), and get the following result:
String foo = (bar!=null)? value1 :
value2;
System.out.println("hello world");
Source code can be very big, and it is convenient to select all and then press (CTRL+I) to format the whole code. Is there a way to avoid the formatting error above? Thanks.