2

It seems, that currently only one constraint/concept can be surpressed by @jQASuppress annotation.

The following

@jQASuppress({"spring-injection:InjectablesShouldBeHeldInFinalFields",
              "spring-injection:FieldsOfInjectablesMustNotBeManipulated"})

nevertheless, this will lead to

[ERROR] Constraint: spring-injection:FieldsOfInjectablesMustNotBeManipulated
[ERROR] Severity: MAJOR
[ERROR] Number of rows: 5
[ERROR] Fields of injectable types must not be manipulated, except from constructors.

Am I doing something wrong?

Oliver
  • 3,815
  • 8
  • 35
  • 63
  • No, actually this is the way it should be used. Can you please file an issue for this problem at https://github.com/jqassistant/jqa-java-plugin? – Oliver Feb 21 '20 at 12:58
  • 1
    Just verified: the jQASuppress mechanism works as expected but the problem is in the rules: The queries behind them need to return the element which causes the violation (e.g. the field) as the first or primary column but they don't do this at the moment. As a workaround you can currently place the jQASuppress annotation for "spring-injection:InjectablesShouldBeHeldInFinalFields" at class level.For "spring-injection:FieldsOfInjectablesMustNotBeManipulated" there's currently no such solution. Needs to be fixed, can you create an issue in https://github.com/jqassistant/jqa-spring-plugin? – Dirk Mahler Feb 21 '20 at 18:48

0 Answers0