Changeset 19113 in josm
- Timestamp:
- 2024-06-18T22:29:22+02:00 (6 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ivy.xml
r19084 r19113 28 28 <!-- parsson is an implementation for jakarta.json --> 29 29 <dependency conf="runtimeOnly->default" org="org.eclipse.parsson" name="parsson" rev="1.1.6"/> 30 <dependency conf="api->default" org="org.apache.commons" name="commons-jcs3-core" rev="3.2 "/>31 <dependency conf="api->default" org="org.apache.commons" name="commons-compress" rev="1.26. 1"/>30 <dependency conf="api->default" org="org.apache.commons" name="commons-jcs3-core" rev="3.2.1"/> 31 <dependency conf="api->default" org="org.apache.commons" name="commons-compress" rev="1.26.2"/> 32 32 <dependency conf="api->default" org="jakarta.annotation" name="jakarta.annotation-api" rev="2.1.1" /> 33 33 <!-- 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 46 <dependency conf="sources->sources" org="jakarta.json" name="jakarta.json-api" rev="2.1.3"/> 47 47 <dependency conf="sources->sources" org="org.eclipse.parsson" name="parsson" rev="1.1.6"/> 48 <dependency conf="sources->sources" org="org.apache.commons" name="commons-jcs3-core" rev="3.2 "/>49 <dependency conf="sources->sources" org="org.apache.commons" name="commons-compress" rev="1.26. 1"/>48 <dependency conf="sources->sources" org="org.apache.commons" name="commons-jcs3-core" rev="3.2.1"/> 49 <dependency conf="sources->sources" org="org.apache.commons" name="commons-compress" rev="1.26.2"/> 50 50 <dependency conf="sources->sources" org="jakarta.annotation" name="jakarta.annotation-api" rev="2.1.1" /> 51 51 <!-- 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 65 <dependency conf="jmockit->default" org="org.jmockit" name="jmockit" rev="1.49.a"/> 66 66 <!-- test->default --> 67 <dependency conf="test->default" org="com.github.spotbugs" name="spotbugs-annotations" rev="4.8. 4"/>67 <dependency conf="test->default" org="com.github.spotbugs" name="spotbugs-annotations" rev="4.8.5"/> 68 68 <dependency conf="test->default" org="com.ginsberg" name="junit5-system-exit" rev="1.1.2"/> 69 <dependency conf="test->default" org="org.wiremock" name="wiremock" rev="3. 5.4"/>70 <dependency conf="test->default" org="io.github.classgraph" name="classgraph" rev="4.8.17 1"/>69 <dependency conf="test->default" org="org.wiremock" name="wiremock" rev="3.6.0"/> 70 <dependency conf="test->default" org="io.github.classgraph" name="classgraph" rev="4.8.173"/> 71 71 <dependency conf="test->default" org="org.junit.platform" name="junit-platform-launcher" rev="1.10.2"/> 72 72 <dependency conf="test->default" org="org.junit.platform" name="junit-platform-suite" rev="1.10.2"/> -
trunk/nodist/pom.xml
r19097 r19113 12 12 <java.lang.version>11</java.lang.version> 13 13 <maven.compiler.release>${java.lang.version}</maven.compiler.release> 14 <maven.compiler.source>${maven.compiler.release}</maven.compiler.source> 15 <maven.compiler.target>${maven.compiler.release}</maven.compiler.target> 14 16 <test.headless>true</test.headless> 15 17 <sonar.host.url>https://josm.openstreetmap.de/sonar/</sonar.host.url> 16 18 <sonar.projectKey>JOSM</sonar.projectKey> 17 19 <jmockit.version>1.49.a</jmockit.version> 20 <pmd.version>7.2.0</pmd.version> 18 21 </properties> 19 22 <modules> … … 72 75 <groupId>org.apache.maven.plugins</groupId> 73 76 <artifactId>maven-pmd-plugin</artifactId> 74 <version>3.22.0</version> 77 <version>3.23.0</version> 78 <dependencies> 79 <dependency> 80 <groupId>net.sourceforge.pmd</groupId> 81 <artifactId>pmd-core</artifactId> 82 <version>${pmd.version}</version> 83 </dependency> 84 <dependency> 85 <groupId>net.sourceforge.pmd</groupId> 86 <artifactId>pmd-java</artifactId> 87 <version>${pmd.version}</version> 88 </dependency> 89 <dependency> 90 <groupId>net.sourceforge.pmd</groupId> 91 <artifactId>pmd-javascript</artifactId> 92 <version>${pmd.version}</version> 93 </dependency> 94 <dependency> 95 <groupId>net.sourceforge.pmd</groupId> 96 <artifactId>pmd-jsp</artifactId> 97 <version>${pmd.version}</version> 98 </dependency> 99 </dependencies> 100 <configuration> 101 <targetJdk>${java.lang.version}</targetJdk> 102 </configuration> 75 103 </plugin> 76 104 <plugin> … … 201 229 <dependencies> 202 230 <dependency> 231 <groupId>org.jmockit</groupId> 232 <artifactId>jmockit</artifactId> 233 <version>${jmockit.version}</version> 234 <scope>test</scope> 235 </dependency> 236 <dependency> 203 237 <groupId>org.junit</groupId> 204 238 <artifactId>junit-bom</artifactId> … … 228 262 <groupId>org.apache.commons</groupId> 229 263 <artifactId>commons-jcs3-core</artifactId> 230 <version>3.2 </version>264 <version>3.2.1</version> 231 265 <scope>provided</scope> 232 266 </dependency> … … 234 268 <groupId>org.apache.commons</groupId> 235 269 <artifactId>commons-compress</artifactId> 236 <version>1.26. 1</version>270 <version>1.26.2</version> 237 271 <scope>provided</scope> 238 272 </dependency> … … 287 321 </dependency> 288 322 <dependency> 289 <groupId>org.jmockit</groupId>290 <artifactId>jmockit</artifactId>291 <version>${jmockit.version}</version>292 <scope>test</scope>293 </dependency>294 <dependency>295 323 <groupId>com.github.spotbugs</groupId> 296 324 <artifactId>spotbugs-annotations</artifactId> … … 313 341 <groupId>io.github.classgraph</groupId> 314 342 <artifactId>classgraph</artifactId> 315 <version>4.8.17 2</version>343 <version>4.8.173</version> 316 344 <scope>test</scope> 317 345 </dependency> -
trunk/scripts/TagInfoExtract.java
r19108 r19113 103 103 * Main method. 104 104 * @param args Main program arguments 105 * @throws Exception if any error occurs 105 * @throws IOException if an IO exception occurs 106 * @throws OsmTransferException if something happened when communicating with the OSM server 107 * @throws ParseException if there was an issue parsing MapCSS 108 * @throws SAXException if there was an issue parsing XML 106 109 */ 107 public static void main(String[] args) throws Exception {110 public static void main(String[] args) throws IOException, OsmTransferException, ParseException, SAXException { 108 111 HttpClient.setFactory(Http1Client::new); 109 112 TagInfoExtract script = new TagInfoExtract(); -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r19108 r19113 38 38 import org.openstreetmap.josm.tools.Utils; 39 39 import org.openstreetmap.josm.tools.bugreport.BugReport; 40 import org.openstreetmap.josm.tools.bugreport.ReportedException; 40 41 41 42 /** … … 223 224 * @param pref the string that defines the custom projection 224 225 */ 225 @SuppressWarnings("PMD.PreserveStackTrace") // PMD 7.2.x doesn't like log + new exception here for some reason.226 226 public CustomProjection(String name, String code, String pref) { 227 227 this.name = name; … … 235 235 update(null); 236 236 } catch (ProjectionConfigurationException ex1) { 237 throw BugReport.intercept(ex1).put("name", name).put("code", code).put("pref", pref); 237 ReportedException reportedException = BugReport.intercept(ex1).put("name", name).put("code", code).put("pref", pref); 238 reportedException.addSuppressed(ex); 239 throw reportedException; 238 240 } 239 241 } -
trunk/tools/ivy.xml
r19048 r19113 17 17 <dependency org="net.java.dev.javacc" name="javacc" rev="7.0.13" conf="javacc->default"/> 18 18 <!-- checkstyle->default --> 19 <dependency org="com.puppycrawl.tools" name="checkstyle" rev="10.1 5.0" conf="checkstyle->default"/>19 <dependency org="com.puppycrawl.tools" name="checkstyle" rev="10.17.0" conf="checkstyle->default"/> 20 20 <!-- proguard->default --> 21 <dependency org="com.guardsquare" name="proguard-ant" rev="7. 4.2" conf="proguard->default"/>21 <dependency org="com.guardsquare" name="proguard-ant" rev="7.5.0" conf="proguard->default"/> 22 22 <!-- pmd->default --> 23 <!-- PMD 7.0.0 has too many false positives right now. When updating, don't forget to add pmd-ant as a new dependency --> 24 <dependency org="net.sourceforge.pmd" name="pmd-core" rev="6.55.0" conf="pmd->default"/> 25 <dependency org="net.sourceforge.pmd" name="pmd-java" rev="6.55.0" conf="pmd->default"/> 26 <dependency org="net.sourceforge.saxon" name="saxon" rev="9.1.0.8" conf="pmd->default"> 27 <artifact name="saxon" type="jar"/> 28 <artifact name="saxon" type="jar" maven:classifier="dom"/> 29 </dependency> 23 <dependency org="net.sourceforge.pmd" name="pmd-core" rev="7.2.0" conf="pmd->default"/> 24 <dependency org="net.sourceforge.pmd" name="pmd-ant" rev="7.2.0" conf="pmd->default"/> 25 <dependency org="net.sourceforge.pmd" name="pmd-java" rev="7.2.0" conf="pmd->default"/> 26 <dependency org="org.xmlresolver" name="xmlresolver" rev="6.0.4" conf="pmd->default"/> 30 27 <!-- spotbugs->default --> 31 <dependency org="com.github.spotbugs" name="spotbugs" rev="4.8. 4" conf="spotbugs->default"/>32 <dependency org="com.github.spotbugs" name="spotbugs-ant" rev="4.8. 4" conf="spotbugs->default"/>28 <dependency org="com.github.spotbugs" name="spotbugs" rev="4.8.5" conf="spotbugs->default"/> 29 <dependency org="com.github.spotbugs" name="spotbugs-ant" rev="4.8.5" conf="spotbugs->default"/> 33 30 <!-- errorprone->default --> 34 <dependency org="com.google.errorprone" name="error_prone_core" rev="2.2 6.1" conf="errorprone->default"/>31 <dependency org="com.google.errorprone" name="error_prone_core" rev="2.28.0" conf="errorprone->default"/> 35 32 <!-- animal->default --> 36 33 <dependency org="org.codehaus.mojo" name="animal-sniffer-ant-tasks" rev="1.23" conf="animal->default"/> -
trunk/tools/pmd/josm-ruleset.xml
r18918 r19113 6 6 7 7 <description>JOSM PMD ruleset</description> 8 <!-- Generated files --> 9 <exclude-pattern>.*/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen/.*</exclude-pattern> 8 10 9 11 <rule ref="category/java/bestpractices.xml"> 10 <exclude name="AccessorClassGeneration"/>11 <exclude name="AccessorMethodGeneration"/>12 12 <exclude name="ArrayIsStoredDirectly"/> 13 13 <exclude name="AvoidPrintStackTrace"/> … … 15 15 <exclude name="AvoidReassigningParameters"/> 16 16 <exclude name="AvoidStringBufferField"/> 17 <exclude name="AvoidUsingHardCodedIP"/>18 17 <exclude name="ConstantsInInterface"/> 19 <exclude name="ForLoopCanBeForeach"/>20 <exclude name="ForLoopVariableCount"/>21 18 <exclude name="GuardLogStatement"/> 22 <exclude name="JUnit4TestShouldUseAfterAnnotation"/> 23 <exclude name="JUnit4TestShouldUseTestAnnotation"/> 19 <exclude name="JUnit4TestShouldUseTestAnnotation" reason="False positive in src/org/openstreetmap/josm/data/validation/Test.java"/> 24 20 <exclude name="LiteralsFirstInComparisons" reason="Introduced in 6.24, some positives in source code at this time. Replaces PositionLiteralsFirstInComparisons."/> 25 21 <exclude name="LooseCoupling"/> 26 22 <exclude name="MethodReturnsInternalArray"/> 27 23 <exclude name="OneDeclarationPerLine"/> 28 <exclude name="PreserveStackTrace"/>29 24 <exclude name="ReplaceHashtableWithMap"/> 30 25 <exclude name="SwitchStmtsShouldHaveDefault"/> 31 26 <exclude name="SystemPrintln"/> 32 27 <exclude name="UnusedAssignment" reason="Introduced in 6.26, some number of positives in source code at this time"/> 33 <exclude name="UnusedFormalParameter"/>34 28 <exclude name="UnusedPrivateMethod" reason="Broken since PMD 6.33, see https://github.com/pmd/pmd/issues/3468"/> 29 <exclude name="UnusedPrivateField" reason="Broken in 7.2.x"/> 35 30 <exclude name="UseVarargs"/> 36 31 </rule> 37 <rule ref="category/java/bestpractices.xml/ PreserveStackTrace">32 <rule ref="category/java/bestpractices.xml/ForLoopCanBeForeach"> 38 33 <properties> 39 <property name="violationSuppressXPath" value="//PrimaryExpression/PrimaryPrefix/Name[@Image='BugReport.intercept']"/> 34 <!-- The list is expanded during iteration --> 35 <property name="violationSuppressXPath" value="//ClassDeclaration[@SimpleName='PurgeCommand']/ClassBody/MethodDeclaration[@Name='build']/Block/IfStatement/Block/ForStatement/InfixExpression/MethodCall/VariableAccess[@Name='relLst']"/> 40 36 </properties> 41 37 </rule> 42 <rule ref="category/java/bestpractices.xml/ UnusedFormalParameter">38 <rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"> 43 39 <properties> 44 <property name="violationSuppressXPath" value="//Annotation[MarkerAnnotation/Name/@SimpleName='Deprecated']/..[MethodDeclaration|ConstructorDeclaration]"/>40 <property name="violationSuppressXPath" value="//ClassDeclaration[@SimpleName='DefaultProxySelector' or @SimpleName='RemoteControl']"/> 45 41 </properties> 46 42 </rule> 47 43 <rule ref="category/java/codestyle.xml"> 48 <exclude name="AbstractNaming"/>49 44 <exclude name="AtLeastOneConstructor"/> 50 <exclude name="AvoidFinalLocalVariable"/>51 <exclude name="AvoidPrefixingMethodParameters"/>52 45 <exclude name="BooleanGetMethodName"/> 53 46 <exclude name="CallSuperInConstructor"/> … … 56 49 <exclude name="ConfusingTernary"/> 57 50 <exclude name="ControlStatementBraces"/> 58 <exclude name="DefaultPackage"/>59 51 <!-- EmptyControlStatement is not configurable, so the behavior of the old excludes of EmptyIfStmt/EmptyWhileStmt (errorprone.xml) while getting new functionality cannot be done --> 60 52 <exclude name="EmptyControlStatement"/> … … 62 54 <exclude name="FieldDeclarationsShouldBeAtStartOfClass"/> 63 55 <exclude name="FieldNamingConventions"/> 64 <exclude name="ForLoopsMustUseBraces"/>65 <exclude name="IfElseStmtsMustUseBraces"/>66 <exclude name="IfStmtsMustUseBraces"/>67 56 <exclude name="LinguisticNaming"/> 68 57 <exclude name="LocalVariableCouldBeFinal"/> … … 81 70 <exclude name="UseUnderscoresInNumericLiterals"/> 82 71 <exclude name="UselessParentheses"/> 83 <exclude name="VariableNamingConventions"/> 84 <exclude name="WhileLoopsMustUseBraces"/> 72 <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."/> 85 73 </rule> 86 74 <rule ref="category/java/codestyle.xml/ShortMethodName"> 87 75 <properties> 88 <property name="violationSuppressXPath" value="//MethodDeclaration[@Name='at' or @Name='ht' or @Name='of' or @Name='ok' or @Name='tr'] 89 | //MethodDeclaration/../../Annotation/MarkerAnnotation/Name[@Image='Deprecated'] 90 | //MethodDeclaration/../../../..[@Image='LambertConformalConic']"/> 76 <property name="violationSuppressXPath" value="//MethodDeclaration[@Name='at' or @Name='ht' or @Name='of' or @Name='ok' or @Name='tr']"/> 91 77 </properties> 92 78 </rule> 93 79 <rule ref="category/java/codestyle.xml/MethodNamingConventions"> 94 80 <properties> 95 <property name="violationSuppressXPath" value="//MethodDeclaration/../../..[@SimpleName='Functions' or @SimpleName='PseudoClasses' or @SimpleName='Role' or @SimpleName='TaggingPreset' or @SimpleName='RegionSpecific']"/>81 <property name="violationSuppressXPath" value="//ClassDeclaration[@SimpleName='Functions' or @SimpleName='PseudoClasses' or @SimpleName='Role' or @SimpleName='TaggingPreset' or @SimpleName='RegionSpecific']"/> 96 82 </properties> 97 83 </rule> … … 99 85 <properties> 100 86 <property name="enumConstantPattern" value="[A-Za-z][A-Za-z_0-9]*"/> 101 <property name="violationSuppressXPath" value="//FieldDeclaration[@ Public='true']102 | //FieldDeclaration/ ../Annotation/MarkerAnnotation/Name[@Image='pref']103 | //FieldDeclaration/ Type/ReferenceType/ClassOrInterfaceType[@Image!='Boolean' and104 @Image!='Byte' and105 @Image!='Character' and106 @Image!='Class' and107 @Image!='Double' and108 @Image!='Enum' and109 @Image!='Float' and110 @Image!='Integer' and111 @Image!='Long' and112 @Image!='Number' and113 @Image!='Short' and114 @Image!='String' ]"/>87 <property name="violationSuppressXPath" value="//FieldDeclaration[@Visibility='public'] 88 | //FieldDeclaration/ModifierList/Annotation[@SimpleName='StructEntry'] 89 | //FieldDeclaration/ClassType[@SimpleName!='Boolean' and 90 @SimpleName!='Byte' and 91 @SimpleName!='Character' and 92 @SimpleName!='Class' and 93 @SimpleName!='Double' and 94 @SimpleName!='Enum' and 95 @SimpleName!='Float' and 96 @SimpleName!='Integer' and 97 @SimpleName!='Long' and 98 @SimpleName!='Number' and 99 @SimpleName!='Short' and 100 @SimpleName!='String' ]"/> 115 101 </properties> 116 102 </rule> … … 124 110 <exclude name="AvoidDeeplyNestedIfStmts"/> 125 111 <exclude name="AvoidRethrowingException"/> 112 <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 <? extends RuntimeException>` is probably a bad long-term idea."/> 126 113 <exclude name="CognitiveComplexity" reason="Introduced in 6.35, some number of positives in source code at this time"/> 127 114 <exclude name="CollapsibleIfStatements"/> … … 142 129 <exclude name="SignatureDeclareThrowsException"/> 143 130 <exclude name="SimplifiedTernary"/> 131 <exclude name="SimplifyBooleanReturns" reason="Increased sensitivity in 7.x; should be fixed in our source code." /> 144 132 <exclude name="SimplifyConditional"/> 145 133 <exclude name="SingularField"/> … … 153 141 <rule ref="category/java/design.xml/SignatureDeclareThrowsException"> 154 142 <properties> 155 <property name="violationSuppressXPath" value="//MethodDeclaration/ ../Annotation/MarkerAnnotation/Name[@Image='Override']"/>143 <property name="violationSuppressXPath" value="//MethodDeclaration/ModifierList/Annotation[@SimpleName='Override']"/> 156 144 <property name="IgnoreJUnitCompletely" value="true"/> 157 145 </properties> … … 167 155 <exclude name="AvoidInstanceofChecksInCatchClause"/> 168 156 <exclude name="AvoidLiteralsInIfCondition"/> 169 <exclude name="CloneThrowsCloneNotSupportedException"/>170 <!-- <exclude name="CloseResource"/> -->171 157 <exclude name="CompareObjectsWithEquals"/> 158 <exclude name="ConfusingArgumentToVarargsMethod" reason="Introduced in 7.1.0; there are false positives in source code at this time."/> 172 159 <exclude name="ConstructorCallsOverridableMethod"/> 173 <exclude name="DataflowAnomalyAnalysis"/>174 160 <exclude name="DoNotTerminateVM"/> 175 161 <exclude name="DontImportSun"/> … … 180 166 <exclude name="NonStaticInitializer"/> 181 167 <exclude name="NullAssignment"/> 182 <exclude name="ReturnEmptyArrayRatherThanNull"/>183 168 <exclude name="ReturnEmptyCollectionRatherThanNull" reason="Introduced in 6.37, there are positives in source code at this time"/> 184 169 <exclude name="SimpleDateFormatNeedsLocale"/> … … 190 175 <rule ref="category/java/errorprone.xml/AvoidAccessibilityAlteration"> 191 176 <properties> 192 <property name="violationSuppressXPath" value="// MethodDeclaration/../../..[@SimpleName='ReflectionUtils']"/>177 <property name="violationSuppressXPath" value="//ClassDeclaration[@SimpleName='ReflectionUtils']"/> 193 178 </properties> 194 179 </rule> 195 180 <rule ref="category/java/performance.xml"> 196 181 <exclude name="AvoidInstantiatingObjectsInLoops"/> 197 <exclude name="AvoidUsingShortType"/>198 182 <exclude name="ConsecutiveLiteralAppends"/> 199 183 <exclude name="InefficientEmptyStringCheck"/> 200 <exclude name="SimplifyStartsWith"/>201 184 <exclude name="InsufficientStringBufferDeclaration" reason="PMD 6.40 has a bug where it doesn't properly count appended strings in if statements."/> 202 185 <exclude name="TooFewBranchesForASwitchStatement"/>
Note:
See TracChangeset
for help on using the changeset viewer.