Koohoolinn
Koohoolinn

Reputation: 1507

SuppressWarnings doesn't work with Sonarqube

I'm trying to suppress the warning "Either override Object.equals(Object), or totally rename the method to prevent any confusion." because it is implemented because of Hibernate's UserType.

Neither of the following works:

@SuppressWarnings(value = "squid:S1201")

or

@SuppressWarnings(value = "S1201")

or

@SuppressWarnings("S1201")

or

@edu.umd.cs.findbugs.annotations.SuppressWarnings(
        value = "SuspiciousEqualsMethodName",
        justification = "Hibernate UserType equals method."
)

or

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
        value = "SuspiciousEqualsMethodName",
        justification = "Hibernate UserType equals method."
)

or

@SuppressWarnings("PMD.SuspiciousEqualsMethodName")

Any ideas?

SonarQube Version 5.1.2 - LGPL v3 - Community with Java plugin v3.4.

Upvotes: 0

Views: 3357

Answers (2)

Koohoolinn
Koohoolinn

Reputation: 1507

We've upgraded to SonarQube 5.6.2 and Java Plugin 4.2 and now it seems work.

Upvotes: 1

G. Ann - SonarSource Team
G. Ann - SonarSource Team

Reputation: 22804

Per SONARJAVA-57, it should be @SuppressWarnings("squid:S1201")

Upvotes: 1

Related Questions