Index: /trunk/ivy.xml
===================================================================
--- /trunk/ivy.xml	(revision 19112)
+++ /trunk/ivy.xml	(revision 19113)
@@ -28,6 +28,6 @@
         <!-- parsson is an implementation for jakarta.json -->
         <dependency conf="runtimeOnly->default" org="org.eclipse.parsson" name="parsson" rev="1.1.6"/>
-        <dependency conf="api->default" org="org.apache.commons" name="commons-jcs3-core" rev="3.2"/>
-        <dependency conf="api->default" org="org.apache.commons" name="commons-compress" rev="1.26.1"/>
+        <dependency conf="api->default" org="org.apache.commons" name="commons-jcs3-core" rev="3.2.1"/>
+        <dependency conf="api->default" org="org.apache.commons" name="commons-compress" rev="1.26.2"/>
         <dependency conf="api->default" org="jakarta.annotation" name="jakarta.annotation-api" rev="2.1.1" />
         <!-- jsr305 has some source files with non-free CC-BY-2.5 license. Remove after 2024-06-01 to give plugins time to migrate. See #23220 for details -->
@@ -46,6 +46,6 @@
         <dependency conf="sources->sources" org="jakarta.json" name="jakarta.json-api" rev="2.1.3"/>
         <dependency conf="sources->sources" org="org.eclipse.parsson" name="parsson" rev="1.1.6"/>
-        <dependency conf="sources->sources" org="org.apache.commons" name="commons-jcs3-core" rev="3.2"/>
-        <dependency conf="sources->sources" org="org.apache.commons" name="commons-compress" rev="1.26.1"/>
+        <dependency conf="sources->sources" org="org.apache.commons" name="commons-jcs3-core" rev="3.2.1"/>
+        <dependency conf="sources->sources" org="org.apache.commons" name="commons-compress" rev="1.26.2"/>
         <dependency conf="sources->sources" org="jakarta.annotation" name="jakarta.annotation-api" rev="2.1.1" />
         <!-- jsr305 has some source files with non-free CC-BY-2.5 license. Remove after 2024-06-01 to give plugins time to migrate. See #23220 for details -->
@@ -65,8 +65,8 @@
         <dependency conf="jmockit->default" org="org.jmockit" name="jmockit" rev="1.49.a"/>
         <!-- test->default -->
-        <dependency conf="test->default" org="com.github.spotbugs" name="spotbugs-annotations" rev="4.8.4"/>
+        <dependency conf="test->default" org="com.github.spotbugs" name="spotbugs-annotations" rev="4.8.5"/>
         <dependency conf="test->default" org="com.ginsberg" name="junit5-system-exit" rev="1.1.2"/>
-        <dependency conf="test->default" org="org.wiremock" name="wiremock" rev="3.5.4"/>
-        <dependency conf="test->default" org="io.github.classgraph" name="classgraph" rev="4.8.171"/>
+        <dependency conf="test->default" org="org.wiremock" name="wiremock" rev="3.6.0"/>
+        <dependency conf="test->default" org="io.github.classgraph" name="classgraph" rev="4.8.173"/>
         <dependency conf="test->default" org="org.junit.platform" name="junit-platform-launcher" rev="1.10.2"/>
         <dependency conf="test->default" org="org.junit.platform" name="junit-platform-suite" rev="1.10.2"/>
Index: /trunk/nodist/pom.xml
===================================================================
--- /trunk/nodist/pom.xml	(revision 19112)
+++ /trunk/nodist/pom.xml	(revision 19113)
@@ -12,8 +12,11 @@
         <java.lang.version>11</java.lang.version>
         <maven.compiler.release>${java.lang.version}</maven.compiler.release>
+        <maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
+        <maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
         <test.headless>true</test.headless>
         <sonar.host.url>https://josm.openstreetmap.de/sonar/</sonar.host.url>
         <sonar.projectKey>JOSM</sonar.projectKey>
         <jmockit.version>1.49.a</jmockit.version>
+        <pmd.version>7.2.0</pmd.version>
     </properties>
     <modules>
@@ -72,5 +75,30 @@
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-pmd-plugin</artifactId>
-                    <version>3.22.0</version>
+                    <version>3.23.0</version>
+                    <dependencies>
+                        <dependency>
+                            <groupId>net.sourceforge.pmd</groupId>
+                            <artifactId>pmd-core</artifactId>
+                            <version>${pmd.version}</version>
+                        </dependency>
+                        <dependency>
+                            <groupId>net.sourceforge.pmd</groupId>
+                            <artifactId>pmd-java</artifactId>
+                            <version>${pmd.version}</version>
+                        </dependency>
+                        <dependency>
+                            <groupId>net.sourceforge.pmd</groupId>
+                            <artifactId>pmd-javascript</artifactId>
+                            <version>${pmd.version}</version>
+                        </dependency>
+                        <dependency>
+                            <groupId>net.sourceforge.pmd</groupId>
+                            <artifactId>pmd-jsp</artifactId>
+                            <version>${pmd.version}</version>
+                        </dependency>
+                    </dependencies>
+                    <configuration>
+                      <targetJdk>${java.lang.version}</targetJdk>
+                    </configuration>
                 </plugin>
                 <plugin>
@@ -201,4 +229,10 @@
         <dependencies>
             <dependency>
+                <groupId>org.jmockit</groupId>
+                <artifactId>jmockit</artifactId>
+                <version>${jmockit.version}</version>
+                <scope>test</scope>
+            </dependency>
+            <dependency>
                 <groupId>org.junit</groupId>
                 <artifactId>junit-bom</artifactId>
@@ -228,5 +262,5 @@
                 <groupId>org.apache.commons</groupId>
                 <artifactId>commons-jcs3-core</artifactId>
-                <version>3.2</version>
+                <version>3.2.1</version>
                 <scope>provided</scope>
             </dependency>
@@ -234,5 +268,5 @@
                 <groupId>org.apache.commons</groupId>
                 <artifactId>commons-compress</artifactId>
-                <version>1.26.1</version>
+                <version>1.26.2</version>
                 <scope>provided</scope>
             </dependency>
@@ -287,10 +321,4 @@
             </dependency>
             <dependency>
-                <groupId>org.jmockit</groupId>
-                <artifactId>jmockit</artifactId>
-                <version>${jmockit.version}</version>
-                <scope>test</scope>
-            </dependency>
-            <dependency>
                 <groupId>com.github.spotbugs</groupId>
                 <artifactId>spotbugs-annotations</artifactId>
@@ -313,5 +341,5 @@
                 <groupId>io.github.classgraph</groupId>
                 <artifactId>classgraph</artifactId>
-                <version>4.8.172</version>
+                <version>4.8.173</version>
                 <scope>test</scope>
             </dependency>
Index: /trunk/scripts/TagInfoExtract.java
===================================================================
--- /trunk/scripts/TagInfoExtract.java	(revision 19112)
+++ /trunk/scripts/TagInfoExtract.java	(revision 19113)
@@ -103,7 +103,10 @@
      * Main method.
      * @param args Main program arguments
-     * @throws Exception if any error occurs
+     * @throws IOException if an IO exception occurs
+     * @throws OsmTransferException if something happened when communicating with the OSM server
+     * @throws ParseException if there was an issue parsing MapCSS
+     * @throws SAXException if there was an issue parsing XML
      */
-    public static void main(String[] args) throws Exception {
+    public static void main(String[] args) throws IOException, OsmTransferException, ParseException, SAXException {
         HttpClient.setFactory(Http1Client::new);
         TagInfoExtract script = new TagInfoExtract();
Index: /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 19112)
+++ /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 19113)
@@ -38,4 +38,5 @@
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.bugreport.BugReport;
+import org.openstreetmap.josm.tools.bugreport.ReportedException;
 
 /**
@@ -223,5 +224,4 @@
      * @param pref the string that defines the custom projection
      */
-    @SuppressWarnings("PMD.PreserveStackTrace") // PMD 7.2.x doesn't like log + new exception here for some reason.
     public CustomProjection(String name, String code, String pref) {
         this.name = name;
@@ -235,5 +235,7 @@
                 update(null);
             } catch (ProjectionConfigurationException ex1) {
-                throw BugReport.intercept(ex1).put("name", name).put("code", code).put("pref", pref);
+                ReportedException reportedException = BugReport.intercept(ex1).put("name", name).put("code", code).put("pref", pref);
+                reportedException.addSuppressed(ex);
+                throw reportedException;
             }
         }
Index: /trunk/tools/ivy.xml
===================================================================
--- /trunk/tools/ivy.xml	(revision 19112)
+++ /trunk/tools/ivy.xml	(revision 19113)
@@ -17,20 +17,17 @@
         <dependency org="net.java.dev.javacc" name="javacc" rev="7.0.13" conf="javacc->default"/>
         <!-- checkstyle->default -->
-        <dependency org="com.puppycrawl.tools" name="checkstyle" rev="10.15.0" conf="checkstyle->default"/>
+        <dependency org="com.puppycrawl.tools" name="checkstyle" rev="10.17.0" conf="checkstyle->default"/>
         <!-- proguard->default -->
-        <dependency org="com.guardsquare" name="proguard-ant" rev="7.4.2" conf="proguard->default"/>
+        <dependency org="com.guardsquare" name="proguard-ant" rev="7.5.0" conf="proguard->default"/>
         <!-- pmd->default -->
-        <!-- PMD 7.0.0 has too many false positives right now. When updating, don't forget to add pmd-ant as a new dependency -->
-        <dependency org="net.sourceforge.pmd" name="pmd-core" rev="6.55.0" conf="pmd->default"/>
-        <dependency org="net.sourceforge.pmd" name="pmd-java" rev="6.55.0" conf="pmd->default"/>
-        <dependency org="net.sourceforge.saxon" name="saxon" rev="9.1.0.8" conf="pmd->default">
-            <artifact name="saxon" type="jar"/>
-            <artifact name="saxon" type="jar" maven:classifier="dom"/>
-        </dependency>
+        <dependency org="net.sourceforge.pmd" name="pmd-core" rev="7.2.0" conf="pmd->default"/>
+        <dependency org="net.sourceforge.pmd" name="pmd-ant" rev="7.2.0" conf="pmd->default"/>
+        <dependency org="net.sourceforge.pmd" name="pmd-java" rev="7.2.0" conf="pmd->default"/>
+        <dependency org="org.xmlresolver" name="xmlresolver" rev="6.0.4" conf="pmd->default"/>
         <!-- spotbugs->default -->
-        <dependency org="com.github.spotbugs" name="spotbugs" rev="4.8.4" conf="spotbugs->default"/>
-        <dependency org="com.github.spotbugs" name="spotbugs-ant" rev="4.8.4" conf="spotbugs->default"/>
+        <dependency org="com.github.spotbugs" name="spotbugs" rev="4.8.5" conf="spotbugs->default"/>
+        <dependency org="com.github.spotbugs" name="spotbugs-ant" rev="4.8.5" conf="spotbugs->default"/>
         <!-- errorprone->default -->
-        <dependency org="com.google.errorprone" name="error_prone_core" rev="2.26.1" conf="errorprone->default"/>
+        <dependency org="com.google.errorprone" name="error_prone_core" rev="2.28.0" conf="errorprone->default"/>
         <!-- animal->default -->
         <dependency org="org.codehaus.mojo" name="animal-sniffer-ant-tasks" rev="1.23" conf="animal->default"/>
Index: /trunk/tools/pmd/josm-ruleset.xml
===================================================================
--- /trunk/tools/pmd/josm-ruleset.xml	(revision 19112)
+++ /trunk/tools/pmd/josm-ruleset.xml	(revision 19113)
@@ -6,8 +6,8 @@
 
   <description>JOSM PMD ruleset</description>
+  <!-- Generated files -->
+  <exclude-pattern>.*/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen/.*</exclude-pattern>
 
   <rule ref="category/java/bestpractices.xml">
-    <exclude name="AccessorClassGeneration"/>
-    <exclude name="AccessorMethodGeneration"/>
     <exclude name="ArrayIsStoredDirectly"/>
     <exclude name="AvoidPrintStackTrace"/>
@@ -15,39 +15,32 @@
     <exclude name="AvoidReassigningParameters"/>
     <exclude name="AvoidStringBufferField"/>
-    <exclude name="AvoidUsingHardCodedIP"/>
     <exclude name="ConstantsInInterface"/>
-    <exclude name="ForLoopCanBeForeach"/>
-    <exclude name="ForLoopVariableCount"/>
     <exclude name="GuardLogStatement"/>
-    <exclude name="JUnit4TestShouldUseAfterAnnotation"/>
-    <exclude name="JUnit4TestShouldUseTestAnnotation"/>
+    <exclude name="JUnit4TestShouldUseTestAnnotation" reason="False positive in src/org/openstreetmap/josm/data/validation/Test.java"/>
     <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="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="UnusedPrivateField" reason="Broken in 7.2.x"/>
     <exclude name="UseVarargs"/>
   </rule>
-  <rule ref="category/java/bestpractices.xml/PreserveStackTrace">
+  <rule ref="category/java/bestpractices.xml/ForLoopCanBeForeach">
     <properties>
-        <property name="violationSuppressXPath" value="//PrimaryExpression/PrimaryPrefix/Name[@Image='BugReport.intercept']"/>
+      <!-- The list is expanded during iteration -->
+      <property name="violationSuppressXPath" value="//ClassDeclaration[@SimpleName='PurgeCommand']/ClassBody/MethodDeclaration[@Name='build']/Block/IfStatement/Block/ForStatement/InfixExpression/MethodCall/VariableAccess[@Name='relLst']"/>
     </properties>
   </rule>
-  <rule ref="category/java/bestpractices.xml/UnusedFormalParameter">
+  <rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP">
     <properties>
-        <property name="violationSuppressXPath" value="//Annotation[MarkerAnnotation/Name/@SimpleName='Deprecated']/..[MethodDeclaration|ConstructorDeclaration]"/>
+      <property name="violationSuppressXPath" value="//ClassDeclaration[@SimpleName='DefaultProxySelector' or @SimpleName='RemoteControl']"/>
     </properties>
   </rule>
   <rule ref="category/java/codestyle.xml">
-    <exclude name="AbstractNaming"/>
     <exclude name="AtLeastOneConstructor"/>
-    <exclude name="AvoidFinalLocalVariable"/>
-    <exclude name="AvoidPrefixingMethodParameters"/>
     <exclude name="BooleanGetMethodName"/>
     <exclude name="CallSuperInConstructor"/>
@@ -56,5 +49,4 @@
     <exclude name="ConfusingTernary"/>
     <exclude name="ControlStatementBraces"/>
-    <exclude name="DefaultPackage"/>
     <!-- EmptyControlStatement is not configurable, so the behavior of the old excludes of EmptyIfStmt/EmptyWhileStmt (errorprone.xml) while getting new functionality cannot be done -->
     <exclude name="EmptyControlStatement"/>
@@ -62,7 +54,4 @@
     <exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
     <exclude name="FieldNamingConventions"/>
-    <exclude name="ForLoopsMustUseBraces"/>
-    <exclude name="IfElseStmtsMustUseBraces"/>
-    <exclude name="IfStmtsMustUseBraces"/>
     <exclude name="LinguisticNaming"/>
     <exclude name="LocalVariableCouldBeFinal"/>
@@ -81,17 +70,14 @@
     <exclude name="UseUnderscoresInNumericLiterals"/>
     <exclude name="UselessParentheses"/>
-    <exclude name="VariableNamingConventions"/>
-    <exclude name="WhileLoopsMustUseBraces"/>
+    <exclude name="UnnecessaryFullyQualifiedName" reason="7.x increased sensitivity (250 new issues), and it now warns on qualified names inside a class, e.g. ClassName.STATIC_VARIABLE. Should probably be fixed in our source code."/>
   </rule>
   <rule ref="category/java/codestyle.xml/ShortMethodName">
     <properties>
-        <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']"/>
+      <property name="violationSuppressXPath" value="//MethodDeclaration[@Name='at' or @Name='ht' or @Name='of' or @Name='ok' or @Name='tr']"/>
     </properties>
   </rule>
   <rule ref="category/java/codestyle.xml/MethodNamingConventions">
     <properties>
-        <property name="violationSuppressXPath" value="//MethodDeclaration/../../..[@SimpleName='Functions' or @SimpleName='PseudoClasses' or @SimpleName='Role' or @SimpleName='TaggingPreset' or @SimpleName='RegionSpecific']"/>
+      <property name="violationSuppressXPath" value="//ClassDeclaration[@SimpleName='Functions' or @SimpleName='PseudoClasses' or @SimpleName='Role' or @SimpleName='TaggingPreset' or @SimpleName='RegionSpecific']"/>
     </properties>
   </rule>
@@ -99,18 +85,18 @@
     <properties>
         <property name="enumConstantPattern" value="[A-Za-z][A-Za-z_0-9]*"/>
-        <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
-                                                                       @Image!='Integer' and
-                                                                       @Image!='Long' and
-                                                                       @Image!='Number' and
-                                                                       @Image!='Short' and
-                                                                       @Image!='String' ]"/>
+        <property name="violationSuppressXPath" value="//FieldDeclaration[@Visibility='public']
+          | //FieldDeclaration/ModifierList/Annotation[@SimpleName='StructEntry']
+          | //FieldDeclaration/ClassType[@SimpleName!='Boolean' and
+                                         @SimpleName!='Byte' and
+                                         @SimpleName!='Character' and
+                                         @SimpleName!='Class' and
+                                         @SimpleName!='Double' and
+                                         @SimpleName!='Enum' and
+                                         @SimpleName!='Float' and
+                                         @SimpleName!='Integer' and
+                                         @SimpleName!='Long' and
+                                         @SimpleName!='Number' and
+                                         @SimpleName!='Short' and
+                                         @SimpleName!='String' ]"/>
     </properties>
   </rule>
@@ -124,4 +110,5 @@
     <exclude name="AvoidDeeplyNestedIfStmts"/>
     <exclude name="AvoidRethrowingException"/>
+    <exclude name="AvoidUncheckedExceptionsInSignatures" reason="We disagree with the reasoning for making this an issue; a strength of Java is verbosity, and warning users about adding `@throws &lt;? extends RuntimeException&gt;` is probably a bad long-term idea."/>
     <exclude name="CognitiveComplexity" reason="Introduced in 6.35, some number of positives in source code at this time"/>
     <exclude name="CollapsibleIfStatements"/>
@@ -142,4 +129,5 @@
     <exclude name="SignatureDeclareThrowsException"/>
     <exclude name="SimplifiedTernary"/>
+    <exclude name="SimplifyBooleanReturns" reason="Increased sensitivity in 7.x; should be fixed in our source code." />
     <exclude name="SimplifyConditional"/>
     <exclude name="SingularField"/>
@@ -153,5 +141,5 @@
   <rule ref="category/java/design.xml/SignatureDeclareThrowsException">
     <properties>
-        <property name="violationSuppressXPath" value="//MethodDeclaration/../Annotation/MarkerAnnotation/Name[@Image='Override']"/>
+        <property name="violationSuppressXPath" value="//MethodDeclaration/ModifierList/Annotation[@SimpleName='Override']"/>
         <property name="IgnoreJUnitCompletely" value="true"/>
     </properties>
@@ -167,9 +155,7 @@
     <exclude name="AvoidInstanceofChecksInCatchClause"/>
     <exclude name="AvoidLiteralsInIfCondition"/>
-    <exclude name="CloneThrowsCloneNotSupportedException"/>
-    <!-- <exclude name="CloseResource"/> -->
     <exclude name="CompareObjectsWithEquals"/>
+    <exclude name="ConfusingArgumentToVarargsMethod" reason="Introduced in 7.1.0; there are false positives in source code at this time."/>
     <exclude name="ConstructorCallsOverridableMethod"/>
-    <exclude name="DataflowAnomalyAnalysis"/>
     <exclude name="DoNotTerminateVM"/>
     <exclude name="DontImportSun"/>
@@ -180,5 +166,4 @@
     <exclude name="NonStaticInitializer"/>
     <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"/>
@@ -190,13 +175,11 @@
   <rule ref="category/java/errorprone.xml/AvoidAccessibilityAlteration">
     <properties>
-      <property name="violationSuppressXPath" value="//MethodDeclaration/../../..[@SimpleName='ReflectionUtils']"/>
+      <property name="violationSuppressXPath" value="//ClassDeclaration[@SimpleName='ReflectionUtils']"/>
     </properties>
   </rule>
   <rule ref="category/java/performance.xml">
     <exclude name="AvoidInstantiatingObjectsInLoops"/>
-    <exclude name="AvoidUsingShortType"/>
     <exclude name="ConsecutiveLiteralAppends"/>
     <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"/>
