Checkstyle issuing an indentation warning on an annotation?

Viewed 3357

I have an annotation like:

@ComponentScan(
  basePackages = {
    "com.example.foo",
    "com.example.bar"
  }   // <--- false positive reported in this line
)
public class FooBar extends WebMvcConfigurerAdapter {
  ...
}

And a Checkstyle configuration of:

<module name="AnnotationUseStyle" />
<module name="Indentation">
  <property name="basicOffset" value="2" />
  <property name="braceAdjustment" value="0" />
  <property name="caseIndent" value="2" />
</module>

When I run my project through Checkstyle, I get an error stating "assign child at indentation level 2 not at correct indentation, 4". This is referencing line 5 of my code example above, i.e. the closing parenthetical for the basePackages property.

What configuration change to Checkstyle would I need to make for this annotation to validate correctly?

1 Answers
Related