We would like to have trivial Java property accessories using the syntax of one line, so they take up much less space and are more readable (in terms of quickly viewing a set of accessories). But we want to provide multi-line method syntax for everything else in our checkstyle configuration. But I'm not sure how to make this exception for accessories in the Checkstyle configuration and suspect that it might not be possible.
So, we would like our accessors to look something like this:
public String getFoo() { return foo; } public void setFoo(String foo) { this.foo = foo; }
[In fact, we would prefer not to have trivial accessories at all, and instead just comment on private member variables using @Property or something else and have creators for us, since writing infinite get and set code does not give real benefits, but what general frustration in Java and aside how this issue goes.]
source share