Index: trunk/tools/checkstyle/src/org/openstreetmap/josm/TopLevelJavadocCheck.java
===================================================================
--- trunk/tools/checkstyle/src/org/openstreetmap/josm/TopLevelJavadocCheck.java	(revision 18331)
+++ trunk/tools/checkstyle/src/org/openstreetmap/josm/TopLevelJavadocCheck.java	(revision 18332)
@@ -87,5 +87,5 @@
     public void visitToken(DetailAST ast) {
         DetailAST parent = ast.getParent();
-        if (parent == null || parent.getType() == TokenTypes.EOF) {
+        if (parent == null || parent.getType() == TokenTypes.COMPILATION_UNIT) {
             foundTopLevelClass = true;
             if (!hasJavadoc(ast)) {
Index: trunk/tools/ivy.xml
===================================================================
--- trunk/tools/ivy.xml	(revision 18331)
+++ trunk/tools/ivy.xml	(revision 18332)
@@ -17,10 +17,10 @@
         <dependency org="net.java.dev.javacc" name="javacc" rev="7.0.10" conf="javacc->default"/>
         <!-- checkstyle->default -->
-        <dependency org="com.puppycrawl.tools" name="checkstyle" rev="8.44" conf="checkstyle->default"/>
+        <dependency org="com.puppycrawl.tools" name="checkstyle" rev="9.2" conf="checkstyle->default"/>
         <!-- proguard->default -->
         <dependency org="com.guardsquare" name="proguard-ant" rev="7.2.0-beta4" conf="proguard->default"/>
         <!-- pmd->default -->
-        <dependency org="net.sourceforge.pmd" name="pmd-core" rev="6.20.0" conf="pmd->default"/>
-        <dependency org="net.sourceforge.pmd" name="pmd-java" rev="6.20.0" conf="pmd->default"/>
+        <dependency org="net.sourceforge.pmd" name="pmd-core" rev="6.41.0" conf="pmd->default"/>
+        <dependency org="net.sourceforge.pmd" name="pmd-java" rev="6.41.0" conf="pmd->default"/>
         <dependency org="net.sourceforge.saxon" name="saxon" rev="9.1.0.8" conf="pmd->default">
             <artifact name="saxon" type="jar"/>
@@ -28,8 +28,8 @@
         </dependency>
         <!-- spotbugs->default -->
-        <dependency org="com.github.spotbugs" name="spotbugs" rev="4.2.3" conf="spotbugs->default"/>
-        <dependency org="com.github.spotbugs" name="spotbugs-ant" rev="4.2.3" conf="spotbugs->default"/>
+        <dependency org="com.github.spotbugs" name="spotbugs" rev="4.5.2" conf="spotbugs->default"/>
+        <dependency org="com.github.spotbugs" name="spotbugs-ant" rev="4.5.2" conf="spotbugs->default"/>
         <!-- errorprone->default -->
-        <dependency org="com.google.errorprone" name="error_prone_core" rev="2.8.1" conf="errorprone->default"/>
+        <dependency org="com.google.errorprone" name="error_prone_core" rev="2.10.0" conf="errorprone->default"/>
         <!-- errorprone->default -->
         <dependency org="com.google.errorprone" name="javac" rev="9+181-r4173-1" conf="errorprone_javac->default"/>
Index: trunk/tools/pmd/josm-ruleset.xml
===================================================================
--- trunk/tools/pmd/josm-ruleset.xml	(revision 18331)
+++ trunk/tools/pmd/josm-ruleset.xml	(revision 18332)
@@ -4,7 +4,7 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
- 
+
   <description>JOSM PMD ruleset</description>
- 
+
   <rule ref="category/java/bestpractices.xml">
     <exclude name="AccessorClassGeneration"/>
@@ -22,13 +22,15 @@
     <exclude name="JUnit4TestShouldUseAfterAnnotation"/>
     <exclude name="JUnit4TestShouldUseTestAnnotation"/>
+    <exclude name="LiteralsFirstInComparisons" reason="Introduced in 6.24, some positives in source code at this time. Replaces PositionLiteralsFirstInComparisons."/>
     <exclude name="LooseCoupling"/>
     <exclude name="MethodReturnsInternalArray"/>
     <exclude name="OneDeclarationPerLine"/>
-    <exclude name="PositionLiteralsFirstInComparisons"/>
     <exclude name="PreserveStackTrace"/>
     <exclude name="ReplaceHashtableWithMap"/>
     <exclude name="SwitchStmtsShouldHaveDefault"/>
     <exclude name="SystemPrintln"/>
+    <exclude name="UnusedAssignment" reason="Introduced in 6.26, some number of positives in source code at this time"/>
     <exclude name="UnusedFormalParameter"/>
+    <exclude name="UnusedPrivateMethod" reason="Broken since PMD 6.33, see https://github.com/pmd/pmd/issues/3468"/>
     <exclude name="UseVarargs"/>
   </rule>
@@ -40,5 +42,5 @@
   <rule ref="category/java/bestpractices.xml/UnusedFormalParameter">
     <properties>
-        <property name="violationSuppressXPath" value="//Annotation[MarkerAnnotation/Name/@Image='Deprecated']/..[MethodDeclaration|ConstructorDeclaration]"/>
+        <property name="violationSuppressXPath" value="//Annotation[MarkerAnnotation/Name/@SimpleName='Deprecated']/..[MethodDeclaration|ConstructorDeclaration]"/>
     </properties>
   </rule>
@@ -73,7 +75,8 @@
     <exclude name="ShortVariable"/>
     <exclude name="TooManyStaticImports"/>
+    <exclude name="UnnecessaryCast" reason="Introduced in 6.24, some positives in source code at this time"/>
     <exclude name="UnnecessaryConstructor"/>
+    <exclude name="UseUnderscoresInNumericLiterals"/>
     <exclude name="UselessParentheses"/>
-    <exclude name="UseUnderscoresInNumericLiterals"/>
     <exclude name="VariableNamingConventions"/>
     <exclude name="WhileLoopsMustUseBraces"/>
@@ -81,12 +84,12 @@
   <rule ref="category/java/codestyle.xml/ShortMethodName">
     <properties>
-        <property name="violationSuppressXPath" value="//MethodDeclarator[@Image='at' or @Image='ht' or @Image='of' or @Image='ok' or @Image='tr']
-          | //MethodDeclarator/../../Annotation/MarkerAnnotation/Name[@Image='Deprecated']
-          | //MethodDeclarator/../../../..[@Image='LambertConformalConic']"/>
+        <property name="violationSuppressXPath" value="//MethodDeclaration[@Name='at' or @Name='ht' or @Name='of' or @Name='ok' or @Name='tr']
+          | //MethodDeclaration/../../Annotation/MarkerAnnotation/Name[@Image='Deprecated']
+          | //MethodDeclaration/../../../..[@Image='LambertConformalConic']"/>
     </properties>
   </rule>
   <rule ref="category/java/codestyle.xml/MethodNamingConventions">
     <properties>
-        <property name="violationSuppressXPath" value="//MethodDeclarator/../../../..[@Image='Functions' or @Image='PseudoClasses' or @Image='Role' or @Image='TaggingPreset']"/>
+        <property name="violationSuppressXPath" value="//MethodDeclaration/../../..[@SimpleName='Functions' or @SimpleName='PseudoClasses' or @SimpleName='Role' or @SimpleName='TaggingPreset']"/>
     </properties>
   </rule>
@@ -96,15 +99,15 @@
         <property name="violationSuppressXPath" value="//FieldDeclaration[@Public='true']
           | //FieldDeclaration/../Annotation/MarkerAnnotation/Name[@Image='pref']
-          | //FieldDeclaration/Type/ReferenceType/ClassOrInterfaceType[@Image!='Boolean' and 
-                                                                       @Image!='Byte' and 
-                                                                       @Image!='Character' and 
-                                                                       @Image!='Class' and 
-                                                                       @Image!='Double' and 
-                                                                       @Image!='Enum' and 
-                                                                       @Image!='Float' and 
+          | //FieldDeclaration/Type/ReferenceType/ClassOrInterfaceType[@Image!='Boolean' and
+                                                                       @Image!='Byte' and
+                                                                       @Image!='Character' and
+                                                                       @Image!='Class' and
+                                                                       @Image!='Double' and
+                                                                       @Image!='Enum' and
+                                                                       @Image!='Float' and
                                                                        @Image!='Integer' and
                                                                        @Image!='Long' and
                                                                        @Image!='Number' and
-                                                                       @Image!='Short' and 
+                                                                       @Image!='Short' and
                                                                        @Image!='String' ]"/>
     </properties>
@@ -119,4 +122,5 @@
     <exclude name="AvoidDeeplyNestedIfStmts"/>
     <exclude name="AvoidRethrowingException"/>
+    <exclude name="CognitiveComplexity" reason="Introduced in 6.35, some number of positives in source code at this time"/>
     <exclude name="CollapsibleIfStatements"/>
     <exclude name="CouplingBetweenObjects"/>
@@ -133,4 +137,5 @@
     <exclude name="LawOfDemeter"/>
     <exclude name="LoosePackageCoupling"/>
+    <exclude name="MutableStaticState" reason="Introduced in 6.35, some number of positives in source code at this time"/>
     <exclude name="NcssCount"/>
     <exclude name="NPathComplexity"/>
@@ -168,9 +173,9 @@
     <exclude name="ConstructorCallsOverridableMethod"/>
     <exclude name="DataflowAnomalyAnalysis"/>
-    <exclude name="DoNotCallSystemExit"/>
+    <exclude name="DoNotTerminateVM"/>
     <exclude name="DontImportSun"/>
     <exclude name="EmptyIfStmt"/>
     <exclude name="EmptyWhileStmt"/>
-    <exclude name="MissingBreakInSwitch"/>
+    <exclude name="ImplicitSwitchFallThrough"/>
     <exclude name="MissingSerialVersionUID"/>
     <exclude name="MissingStaticMethodInNonInstantiatableClass"/>
@@ -178,4 +183,5 @@
     <exclude name="NullAssignment"/>
     <exclude name="ReturnEmptyArrayRatherThanNull"/>
+    <exclude name="ReturnEmptyCollectionRatherThanNull" reason="Introduced in 6.37, there are positives in source code at this time"/>
     <exclude name="SimpleDateFormatNeedsLocale"/>
     <exclude name="SingleMethodSingleton"/>
@@ -183,4 +189,9 @@
     <exclude name="TestClassWithoutTestCases"/>
     <exclude name="UseProperClassLoader"/>
+  </rule>
+  <rule ref="category/java/errorprone.xml/AvoidAccessibilityAlteration">
+    <properties>
+      <property name="violationSuppressXPath" value="//MethodDeclaration/../../..[@SimpleName='ReflectionUtils']"/>
+    </properties>
   </rule>
   <rule ref="category/java/performance.xml">
@@ -190,4 +201,5 @@
     <exclude name="InefficientEmptyStringCheck"/>
     <exclude name="SimplifyStartsWith"/>
+    <exclude name="InsufficientStringBufferDeclaration" reason="PMD 6.40 has a bug where it doesn't properly count appended strings in if statements."/>
     <exclude name="TooFewBranchesForASwitchStatement"/>
     <exclude name="UseArrayListInsteadOfVector"/>
