I use IntelliJ IDEA 13.1.5 to write Java code that uses the free APIs, and I noticed that when I close the block around the "smooth" part of the code, then IDEA automatically aligns the "free" code in one line,
For example, if I have this method:
public int sendMessage(Message message) { Response response = JerseyClientHelper.target(serverUrl) .header("User-Agent", userAgent) .post(Entity.entity(message)); return response.getStatus(); }
and I'm trying to wrap it in a new if block, then I would print an if condition and open the block:
public int sendMessage(Message message) { if (message != null) { Response response = JerseyClientHelper.target(serverUrl) .header("User-Agent", userAgent) .post(Entity.entity(message)); return response.getStatus();
but as soon as I type } , to close the block, IntelliJ aligns the code in one line:
public int sendMessage(Message message) { if (message != null) { Response response = JerseyClientHelper.target(serverUrl).header("User-Agent", userAgent).post(Entity.entity(message)); return response.getStatus(); } }
Is there a way to disable auto-alignment of poor APIs? I looked through the sections "Code Style β Java" and "Code Style β General", but could not find anything that would be specifically related to this.
user4118620
source share