Community
Participate
Working Groups
The java format setting New Lines/Annotations/ Force New Lines makes sense for class and method annotations, but not for parameter annotations. This preference should exclude method parameters. For example (if the method signature needed to wrap) public void myLongMethod(String foo, @Nullable String bar) is formated public void myLongMethod(String foo, @Nullable String bar) but I think it would be much better as public void myLongMethod(String foo, @Nullable String bar)
see also bug 207809
*** Bug 213080 has been marked as a duplicate of this bug. ***
*** Bug 215190 has been marked as a duplicate of this bug. ***
I am willing to supply a patch for this one, but i am not sure which options need to be supplied. I can see a few usecases: 1. don't do any newlines just use normal parameter wrapping rules) 2. put each annotation and parameter on a new line (including first annotation) 3. variation on case 2, but not for parameters with a single annotation Are there others that need to be taken into consideration? Perhaps these options will be enough: 1. before first parameter annotation 2. after last parameter annotation 3. after parameter annotation 4. keep parameters with one annotation on same line
Fix for bug 122247 should provide 3 new options to better handle the addition of new lines after annotations and differentiate annotations on: - members (field, method, type) - parameters - local variable *** This bug has been marked as a duplicate of bug 122247 ***
Verified for 3.4M5 using I20080205-0010