Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

intellij stop autoformatting a blank line around java initializer code that uses braces

IntelliJ formats this code

TypeReference ref = new TypeReference<ArrayList<CrawlRequest>>() {};

by inserting a newline after the left curly brace

TypeReference ref = new TypeReference<ArrayList<CrawlRequest>>() {
};

Is there any way to stop it from doing this?

like image 925
Popcorn Avatar asked Jul 31 '13 01:07

Popcorn


1 Answers

Have a look at the Java Code Style settings, in the Wrapping and Braces tab. Oddly enough, it's the Simple classes in one line option that controls the adding of the newline in your line of code.

IntelliJ Code style settings page

like image 51
drvdijk Avatar answered Oct 20 '22 23:10

drvdijk