Menu

#99 keep 1-line methods on same line

open
5
2003-09-21
2002-03-07
Anonymous
No

Silmilar to existing functionality "Empty methods and
constructors remain on single line" I'd like to an
option to override standard block settings for one
line methods. (usually get/set).
for example:

public class TestClass extends Object
{
private String privateField;
private boolean isFlagged;

public String getField() {return privateField;}
public boolean isFlagged() {return isFlagged;}

}

when my standard settings would normally format like:

public String getField()
{
return privateField;
}

public boolean isFlagged()
{
return isFlagged;
}

I'm not sure, but I don't think this would be useful
to have seperate options to additionally do it for
if/else, or try/catch blocks. IMHO, Those look better
when consistant, but get/set look good when condensed
in and grouped in their own section.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Yes, I second this request. It would be really nice to have an
    option that allows methods with only one-statement to be on
    one line. Mainly methods like getters/setters.

     
  • Mike Atkinson

    Mike Atkinson - 2003-09-21
    • assigned_to: nobody --> mikeatkinson
     

Log in to post a comment.

Auth0 Logo