@SuppressWarnings more than one rule does not work

PMD and SonarQube are good tools, but I have problems suppressing PMD warnings.

We use Lombok a lot in our project, so many model classes have: @SuppressWarnings ("PMD.UnusedPrivateField") as class-level annotations.

This works great.

The problem is that if I don't ignore another rule, I would expect the following syntax: @SuppressWarnings (value = {"PMD.UnusedPrivateField", "PMD.SingularField"}) This looks like the correct syntax, as well as reading the annotation implementation PMD

However, this does not seem to work: None of the rules are now suppressed.

+4
source share
2

( "value =" ):

@SuppressWarnings({"PMD.UnusedPrivateField", "PMD.SingularField"})

PMD 5.1.3 ( Eclipse , ).

+6

@colbadhombre:

@SuppressWarnings({"PMD.UnusedPrivateField", "PMD.SingularField"})

.

Eclipse:
- > - > Java- > - > /

  • " '@SuppressWarnings':"
  • "" @SuppressWarnings "
+1

Source: https://habr.com/ru/post/1534979/


All Articles