Eclipse Formatting and Double Brace Initialization

Can I configure the Eclipse formatter to format Double Brace Initialization ?

Thanks.

+4
source share
1 answer

This is not the actual answer, but since I cannot show you the formatted code in the comment, I use this.

Unformatted code:

new ArrayList<String>() { { add("RJ"); add("MJ");}}; 

Formatted Code [ECLIPSE Formatting]

  new ArrayList<String>() { { add("RJ"); add("MJ"); } }; 

I somehow feel that it is Beautifully formatted. Are you asking for something else?

0
source

Source: https://habr.com/ru/post/1416523/


All Articles