diff --git a/fernet-aws-secrets-manager-rotator/src/main/java/com/macasaet/fernet/aws/secretsmanager/rotation/AbstractFernetKeyRotator.java b/fernet-aws-secrets-manager-rotator/src/main/java/com/macasaet/fernet/aws/secretsmanager/rotation/AbstractFernetKeyRotator.java
index eb0dd021..89c80467 100644
--- a/fernet-aws-secrets-manager-rotator/src/main/java/com/macasaet/fernet/aws/secretsmanager/rotation/AbstractFernetKeyRotator.java
+++ b/fernet-aws-secrets-manager-rotator/src/main/java/com/macasaet/fernet/aws/secretsmanager/rotation/AbstractFernetKeyRotator.java
@@ -49,7 +49,7 @@
*
Copyright © 2018 Carlos Macasaet.
* @author Carlos Macasaet
*/
-@SuppressWarnings({"PMD.BeanMembersShouldSerialize", "PMD.TooManyMethods"})
+@SuppressWarnings("PMD.TooManyMethods")
abstract class AbstractFernetKeyRotator implements RequestStreamHandler {
private final Logger logger = LogManager.getLogger(getClass());
@@ -177,7 +177,6 @@ protected void conditionallyCreateSecret(final String secretId, final String cli
*/
protected abstract void testSecret(String secretId, String clientRequestToken);
- @SuppressWarnings("PMD.DataflowAnomalyAnalysis")
protected void finishSecret(final String secretId, final String clientRequestToken,
final Map> versions) {
final Entry extends String, ?> currentEntry = versions.entrySet().stream().filter(entry -> {
diff --git a/fernet-java8/src/main/java/com/macasaet/fernet/Key.java b/fernet-java8/src/main/java/com/macasaet/fernet/Key.java
index 44170384..06ef9d07 100644
--- a/fernet-java8/src/main/java/com/macasaet/fernet/Key.java
+++ b/fernet-java8/src/main/java/com/macasaet/fernet/Key.java
@@ -57,7 +57,7 @@
*
* @author Carlos Macasaet
*/
-@SuppressWarnings({"PMD.AvoidDuplicateLiterals", "PMD.TooManyMethods", "PMD.GodClass"})
+@SuppressWarnings("PMD.GodClass")
public class Key {
private final byte[] signingKey;
diff --git a/fernet-java8/src/main/java/com/macasaet/fernet/StringObjectValidator.java b/fernet-java8/src/main/java/com/macasaet/fernet/StringObjectValidator.java
index aac37c89..055ce85b 100644
--- a/fernet-java8/src/main/java/com/macasaet/fernet/StringObjectValidator.java
+++ b/fernet-java8/src/main/java/com/macasaet/fernet/StringObjectValidator.java
@@ -33,6 +33,7 @@
* The type of the payload. The Fernet token encodes the payload in binary. The type T should be a domain
* object or data transfer object representation of that data.
*/
+@SuppressWarnings("PMD.ImplicitFunctionalInterface")
public interface StringObjectValidator extends Validator {
default Charset getCharset() {
diff --git a/fernet-java8/src/main/java/com/macasaet/fernet/Token.java b/fernet-java8/src/main/java/com/macasaet/fernet/Token.java
index 39d9fe70..9cc6e5ac 100644
--- a/fernet-java8/src/main/java/com/macasaet/fernet/Token.java
+++ b/fernet-java8/src/main/java/com/macasaet/fernet/Token.java
@@ -47,7 +47,7 @@
*
* @author Carlos Macasaet
*/
-@SuppressWarnings({"PMD.TooManyMethods", "PMD.AvoidDuplicateLiterals", "PMD.GodClass"})
+@SuppressWarnings({"PMD.TooManyMethods", "PMD.GodClass"})
/*
* TooManyMethods can be avoided by making the following API-breaking changes:
* * remove the static `generate` methods and introduce a `TokenFactory` or `TokenBuilder`
@@ -117,7 +117,6 @@ protected Token(final byte version, final Instant timestamp, final IvParameterSp
* @throws IllegalTokenException if the input string cannot be a valid
* token irrespective of key or timestamp.
*/
- @SuppressWarnings({"PMD.PrematureDeclaration", "PMD.DataflowAnomalyAnalysis"})
public static Token fromBytes(final byte[] bytes) {
if (bytes.length < minimumTokenBytes) {
throw new IllegalTokenException("Not enough bits to generate a Token");
diff --git a/fernet-java8/src/main/java/com/macasaet/fernet/Validator.java b/fernet-java8/src/main/java/com/macasaet/fernet/Validator.java
index 5db5e93a..5c6c10d4 100644
--- a/fernet-java8/src/main/java/com/macasaet/fernet/Validator.java
+++ b/fernet-java8/src/main/java/com/macasaet/fernet/Validator.java
@@ -39,6 +39,7 @@
* @see StringValidator
* @author Carlos Macasaet
*/
+@SuppressWarnings("PMD.ImplicitFunctionalInterface")
public interface Validator {
/**
@@ -98,7 +99,6 @@ default Predicate getObjectValidator() {
* @return the deserialised contents of the token
* @throws TokenValidationException if the token is invalid.
*/
- @SuppressWarnings("PMD.DataflowAnomalyAnalysis")
default T validateAndDecrypt(final Key key, final Token token) {
final Instant now = Instant.now(getClock());
final byte[] plainText = token.validateAndDecrypt(key, now.minus(getTimeToLive()), now.plus(getMaxClockSkew()));
diff --git a/src/main/config/pmd-ruleset.xml b/src/main/config/pmd-ruleset.xml
index cf527d0f..d8e31960 100644
--- a/src/main/config/pmd-ruleset.xml
+++ b/src/main/config/pmd-ruleset.xml
@@ -59,6 +59,7 @@ under the License.
+