Skip to content

Commit 38836e7

Browse files
authored
[NO-TICKET] Update pmd version (#208)
1 parent 7080a8e commit 38836e7

File tree

3 files changed

+14
-29
lines changed

3 files changed

+14
-29
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ gradle-nexus-publish-plugin = "2.0.0"
1414
datadog-statsd = "4.4.4"
1515
# Verify
1616
checkstyle = "8.44"
17-
pmd = "6.55.0"
17+
pmd = "7.14.0"
1818
jacoco = "0.8.13"
1919
# Testing
2020
mockito = "5.17.0"

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: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,37 @@
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/OneDeclarationPerLine">
16-
<properties>
17-
<property name="strictMode" value="false"/>
18-
</properties>
19-
</rule>
20-
<rule ref="category/java/bestpractices.xml/SwitchStmtsShouldHaveDefault"/>
15+
<rule ref="category/java/bestpractices.xml/NonExhaustiveSwitch"/>
16+
<rule ref="category/java/bestpractices.xml/PrimitiveWrapperInstantiation" />
17+
<rule ref="category/java/bestpractices.xml/SimplifiableTestAssertion" />
2118
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/>
22-
<rule ref="category/java/bestpractices.xml/UnusedImports"/>
2319
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable"/>
2420
<rule ref="category/java/bestpractices.xml/UnusedPrivateField"/>
2521
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/>
2622

2723
<rule ref="category/java/codestyle.xml/ClassNamingConventions"/>
28-
<rule ref="category/java/codestyle.xml/DefaultPackage"/>
29-
<rule ref="category/java/codestyle.xml/DontImportJavaLang"/>
24+
<rule ref="category/java/codestyle.xml/CommentDefaultAccessModifier" />
25+
<rule ref="category/java/codestyle.xml/EmptyControlStatement" />
3026
<rule ref="category/java/codestyle.xml/ExtendsObject"/>
3127
<rule ref="category/java/codestyle.xml/FieldDeclarationsShouldBeAtStartOfClass"/>
3228
<rule ref="category/java/codestyle.xml/GenericsNaming"/>
3329
<rule ref="category/java/codestyle.xml/MethodNamingConventions"/>
3430
<rule ref="category/java/codestyle.xml/NoPackage"/>
3531
<rule ref="category/java/codestyle.xml/PackageCase"/>
32+
<rule ref="category/java/codestyle.xml/UnnecessaryBoxing" />
3633
<rule ref="category/java/codestyle.xml/UnnecessaryConstructor"/>
3734
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName"/>
35+
<rule ref="category/java/codestyle.xml/UnnecessaryImport" />
3836
<rule ref="category/java/codestyle.xml/UnnecessaryReturn"/>
37+
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon" />
3938

4039
<rule ref="category/java/design.xml/AvoidThrowingNullPointerException"/>
4140
<rule ref="category/java/design.xml/AvoidThrowingRawExceptionTypes"/>
4241
<rule ref="category/java/design.xml/CollapsibleIfStatements"/>
43-
<rule ref="category/java/design.xml/ExcessiveClassLength"/>
44-
<rule ref="category/java/design.xml/ExcessiveMethodLength"/>
4542
<rule ref="category/java/design.xml/ExcessiveParameterList"/>
4643
<rule ref="category/java/design.xml/LogicInversion"/>
44+
<rule ref="category/java/design.xml/NcssCount" />
4745
<rule ref="category/java/design.xml/NPathComplexity"/>
48-
<rule ref="category/java/design.xml/SimplifyBooleanAssertion"/>
4946
<rule ref="category/java/design.xml/SimplifyBooleanExpressions"/>
5047
<rule ref="category/java/design.xml/SimplifyBooleanReturns"/>
5148
<rule ref="category/java/design.xml/SingularField"/>
@@ -62,31 +59,23 @@
6259
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
6360
<rule ref="category/java/errorprone.xml/CheckSkipResult"/>
6461
<rule ref="category/java/errorprone.xml/CompareObjectsWithEquals"/>
65-
<rule ref="category/java/errorprone.xml/DoNotCallSystemExit"/>
62+
<rule ref="category/java/errorprone.xml/DoNotTerminateVM" />
6663
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
6764
<rule ref="category/java/errorprone.xml/EmptyFinalizer"/>
68-
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock"/>
69-
<rule ref="category/java/errorprone.xml/EmptyIfStmt"/>
70-
<rule ref="category/java/errorprone.xml/EmptyInitializer"/>
71-
<rule ref="category/java/errorprone.xml/EmptyStatementBlock"/>
72-
<rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop"/>
73-
<rule ref="category/java/errorprone.xml/EmptySwitchStatements"/>
74-
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock"/>
75-
<rule ref="category/java/errorprone.xml/EmptyTryBlock"/>
7665
<rule ref="category/java/errorprone.xml/EqualsNull"/>
66+
<rule ref="category/java/errorprone.xml/ImplicitSwitchFallThrough" />
7767
<rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
7868
<rule ref="category/java/errorprone.xml/JUnitSpelling"/>
7969
<rule ref="category/java/errorprone.xml/JUnitStaticSuite"/>
8070
<rule ref="category/java/errorprone.xml/MethodWithSameNameAsEnclosingClass"/>
8171
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
82-
<rule ref="category/java/errorprone.xml/MissingBreakInSwitch"/>
8372
<rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass">
8473
<properties>
8574
<property name="annotations"
8675
value="org.springframework.beans.factory.annotation.Autowired, javax.inject.Inject"/>
8776
</properties>
8877
</rule>
89-
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement"/>
78+
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitch"/>
9079
<rule ref="category/java/errorprone.xml/NonStaticInitializer"/>
9180
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock"/>
9281
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement"/>
@@ -98,7 +87,6 @@
9887
<rule ref="category/java/multithreading.xml/AvoidThreadGroup"/>
9988
<rule ref="category/java/multithreading.xml/DontCallThreadRun"/>
10089

101-
<rule ref="category/java/performance.xml/BooleanInstantiation"/>
10290
<rule ref="category/java/performance.xml/StringInstantiation"/>
10391
<rule ref="category/java/performance.xml/StringToString"/>
10492
<rule ref="category/java/performance.xml/UseStringBufferLength"/>

0 commit comments

Comments
 (0)