#439 Annotations wrongly identified as a line wrap

release_4.2
closed
nobody
5
2012-10-10
2006-08-18
CN Yee
No

Scenario:

lcury check is set to nlow and I have the following
method declarations:

@SuppressWarnings("unchecked")
public T findById(ID id, boolean lock) {
    ...  
}

Checkstyle complains that the left curly should be on
the next line.

Checkstyle is not really wrong as the annotation line
does really belong to the the method definition, so
there is indeed a wrap in the line. But from
formatting point of view the annotation should be
treated apart.

Discussion

  • Logged In: YES
    user_id=378738
    Originator: NO

    This is bugging me too, because it complains about @Overrides:

    @Override
    public void someMethod() {
    ...
    }

    On a big project, this results on a lot of false violations.

     
  • Oliver Burn
    Oliver Burn
    2009-04-15

    fixed in release 5