Reformat with "Simple methods in one line"

I have tried eclipse and netbeans and all of the reformatting tools like jindent and jalopy, but just could not do the following one line format for simple methods.  Intellij almost does this, but not quite.  All of our codes literally thousands of files were developed using the jbuilder in the past 8 years with the format below and now jbuilder has gone to eclipse the reformatting changes all the code.  We are in the market for a new IDE which can handle our problem below.  We have been a faithful jbuilder user for past 8 years, but we need to find another IDE for our company.

Does anyone know if the code can be retained as a single line after the reformat?  It has two (or three) statements inside the method and I would very much like to keep it as a single line as there are many of these methods.

    public Tester setName(String name)  { = name;  return this;  }

Whenever I reformat with intellij or any other IDE, it turns them into 4 lines below.

    public Tester setName(String name) { = name;
        return this;

Much appreciated.

1 comment
Comment actions Permalink

Goto Settings->Code Style->Alignment and Braces and check the "Simple methods in one line" and the "Simple block in one line" options and see if that does what you want it to.


Please sign in to leave a comment.