Skip to content

Commit bec643a

Browse files
committed
[NO-TICKET] Remove pmd warnings & fix error in pmd
1 parent 1255226 commit bec643a

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

openapi-validation-core/src/main/java/com/getyourguide/openapi/validation/core/log/ThrottlingOpenApiViolationHandler.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ private void registerLoggedMessage(OpenApiViolation openApiViolation) {
3131
private boolean isThrottled(OpenApiViolation openApiViolation) {
3232
var key = buildKey(openApiViolation);
3333
var lastLoggedTime = loggedMessages.get(key);
34-
if (lastLoggedTime == null) {
35-
return false;
36-
}
37-
return lastLoggedTime.plusSeconds(waitSeconds).isAfterNow();
34+
return lastLoggedTime != null && lastLoggedTime.plusSeconds(waitSeconds).isAfterNow();
3835
}
3936

4037
@NonNull

ruleset.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<rule ref="category/java/bestpractices.xml/AvoidReassigningParameters"/>
1313
<rule ref="category/java/bestpractices.xml/CheckResultSet"/>
1414
<rule ref="category/java/bestpractices.xml/DoubleBraceInitialization"/>
15+
<rule ref="category/java/bestpractices.xml/NonExhaustiveSwitch"/>
1516
<rule ref="category/java/bestpractices.xml/PrimitiveWrapperInstantiation" />
1617
<rule ref="category/java/bestpractices.xml/SimplifiableTestAssertion" />
17-
<rule ref="category/java/bestpractices.xml/SwitchStmtsShouldHaveDefault"/>
1818
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/>
1919
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable"/>
2020
<rule ref="category/java/bestpractices.xml/UnusedPrivateField"/>
@@ -75,7 +75,7 @@
7575
value="org.springframework.beans.factory.annotation.Autowired, javax.inject.Inject"/>
7676
</properties>
7777
</rule>
78-
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement"/>
78+
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitch"/>
7979
<rule ref="category/java/errorprone.xml/NonStaticInitializer"/>
8080
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock"/>
8181
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement"/>

0 commit comments

Comments
 (0)