Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-5934

String handling issues identified by PMD

    Details

    • Flags:
      Patch

      Description

      The code linting tool PMD identified numerous places where Maven's string handling is inefficient. I've prepared a set of patches that should help speed things up.

      The command I used was `pmd -d . -R java-strings`

        Issue Links

          Activity

          Hide
          michael-o Michael Osipov added a comment -

          Please open a pull request on GitHub, I will have a look.

          Show
          michael-o Michael Osipov added a comment - Please open a pull request on GitHub, I will have a look.
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in maven-3.x #1195 (See https://builds.apache.org/job/maven-3.x/1195/)
          MNG-5934 String handling issues identified by PMD Submitted by: Alex (schulte: rev 2d3b5811566190b52840e27cd04eb26bd02bb1b4)

          • maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
          • maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraphVertex.java
          • maven-core/src/main/java/org/apache/maven/project/MavenProject.java
          • maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraph.java
          • maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java
          • maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java
          • maven-compat/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java
          • maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblem.java
          • maven-artifact/src/main/java/org/apache/maven/artifact/versioning/Restriction.java
          • maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java
          • maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java
          • maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
          • maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java
          • maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java
          • maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferEvent.java
          • maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java
          • maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java
          • maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoNotFoundException.java
          • maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java
          • maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemUtils.java
          • maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java
          • maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
          • maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/AbstractArtifactMetadata.java
          • maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java
          • maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
          • maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
          • maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java
          • maven-compat/src/test/java/org/apache/maven/project/inheritance/AbstractProjectInheritanceTestCase.java
          • maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
          • maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblem.java
          • maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblem.java
          • maven-core/src/main/java/org/apache/maven/plugin/MojoExecution.java
          • maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
          • maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
          • maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java
          • maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
          • maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java
          • maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java
          • maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in maven-3.x #1195 (See https://builds.apache.org/job/maven-3.x/1195/ ) MNG-5934 String handling issues identified by PMD Submitted by: Alex (schulte: rev 2d3b5811566190b52840e27cd04eb26bd02bb1b4) maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraphVertex.java maven-core/src/main/java/org/apache/maven/project/MavenProject.java maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraph.java maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java maven-compat/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblem.java maven-artifact/src/main/java/org/apache/maven/artifact/versioning/Restriction.java maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutionException.java maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferEvent.java maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoNotFoundException.java maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemUtils.java maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/AbstractArtifactMetadata.java maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java maven-compat/src/test/java/org/apache/maven/project/inheritance/AbstractProjectInheritanceTestCase.java maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblem.java maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblem.java maven-core/src/main/java/org/apache/maven/plugin/MojoExecution.java maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user ChristianSchulte commented on the pull request:

          https://github.com/apache/maven/pull/72#issuecomment-181984267

          This has been committed. See MNG-5934. Please close this pull request manually.

          Show
          githubbot ASF GitHub Bot added a comment - Github user ChristianSchulte commented on the pull request: https://github.com/apache/maven/pull/72#issuecomment-181984267 This has been committed. See MNG-5934 . Please close this pull request manually.
          Hide
          stephenc Stephen Connolly added a comment -

          Maven 3.4.0 has been dropped. See this thread for more details.

          This issue will need to be re-scheduled for a Maven release in the (hopefully near) future.

          Show
          stephenc Stephen Connolly added a comment - Maven 3.4.0 has been dropped. See this thread for more details. This issue will need to be re-scheduled for a Maven release in the (hopefully near) future.
          Hide
          michael-o Michael Osipov added a comment -
          Show
          michael-o Michael Osipov added a comment - Fixed with 8d91726f7872f4462d9fa085ef5b6f32bfd0a2e1 .
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build maven-3.x #1543 (See https://builds.apache.org/job/maven-3.x/1543/)
          MNG-5934 String handling issues identified by PMD (michaelo: http://git-wip-us.apache.org/repos/asf/?p=maven.git&a=commit&h=8d91726f7872f4462d9fa085ef5b6f32bfd0a2e1)

          • (edit) maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
          • (edit) maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java
          • (edit) maven-compat/src/test/java/org/apache/maven/project/inheritance/AbstractProjectInheritanceTestCase.java
          • (edit) maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java
          • (edit) maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferEvent.java
          • (edit) maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java
          • (edit) maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java
          • (edit) maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java
          • (edit) maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
          • (edit) maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java
          • (edit) maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblem.java
          • (edit) maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java
          • (edit) maven-compat/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java
          • (edit) maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java
          • (edit) maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java
          • (edit) maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java
          • (edit) maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java
          • (edit) maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoNotFoundException.java
          • (edit) maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
          • (edit) maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblem.java
          • (edit) maven-core/src/main/java/org/apache/maven/plugin/MojoExecution.java
          • (edit) maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemUtils.java
          • (edit) maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
          • (edit) maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java
          • (edit) maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java
          • (edit) maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java
          • (edit) maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java
          • (edit) maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java
          • (edit) maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java
          • (edit) maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
          • (edit) maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblem.java
          • (edit) maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraph.java
          • (edit) maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/AbstractArtifactMetadata.java
          • (edit) maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java
          • (edit) maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraphVertex.java
          • (edit) maven-core/src/main/java/org/apache/maven/project/MavenProject.java
          • (edit) maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java
          • (edit) maven-artifact/src/main/java/org/apache/maven/artifact/versioning/Restriction.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-3.x #1543 (See https://builds.apache.org/job/maven-3.x/1543/ ) MNG-5934 String handling issues identified by PMD (michaelo: http://git-wip-us.apache.org/repos/asf/?p=maven.git&a=commit&h=8d91726f7872f4462d9fa085ef5b6f32bfd0a2e1 ) (edit) maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java (edit) maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java (edit) maven-compat/src/test/java/org/apache/maven/project/inheritance/AbstractProjectInheritanceTestCase.java (edit) maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/UnsupportedSlf4jBindingConfiguration.java (edit) maven-core/src/main/java/org/apache/maven/repository/ArtifactTransferEvent.java (edit) maven-artifact/src/main/java/org/apache/maven/artifact/resolver/MultipleArtifactsNotFoundException.java (edit) maven-artifact/src/main/java/org/apache/maven/artifact/versioning/DefaultArtifactVersion.java (edit) maven-compat/src/main/java/org/apache/maven/repository/MetadataResolutionResult.java (edit) maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java (edit) maven-embedder/src/main/java/org/apache/maven/cli/CLIReportingUtils.java (edit) maven-settings-builder/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblem.java (edit) maven-core/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java (edit) maven-compat/src/main/java/org/apache/maven/artifact/versioning/ManagedVersionMap.java (edit) maven-compat/src/main/java/org/apache/maven/project/validation/ModelValidationResult.java (edit) maven-core/src/main/java/org/apache/maven/plugin/PluginParameterException.java (edit) maven-core/src/main/java/org/apache/maven/plugin/PluginParameterExpressionEvaluator.java (edit) maven-embedder/src/test/java/org/apache/maven/cli/CLIManagerDocumentationTest.java (edit) maven-plugin-api/src/main/java/org/apache/maven/plugin/MojoNotFoundException.java (edit) maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java (edit) maven-builder-support/src/main/java/org/apache/maven/building/DefaultProblem.java (edit) maven-core/src/main/java/org/apache/maven/plugin/MojoExecution.java (edit) maven-model-builder/src/main/java/org/apache/maven/model/building/ModelProblemUtils.java (edit) maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java (edit) maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecyclePhase.java (edit) maven-core/src/main/java/org/apache/maven/artifact/repository/MavenArtifactRepository.java (edit) maven-core/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionResult.java (edit) maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java (edit) maven-compat/src/test/java/org/apache/maven/project/LegacyLocalRepositoryManager.java (edit) maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java (edit) maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java (edit) maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelProblem.java (edit) maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraph.java (edit) maven-core/src/main/java/org/apache/maven/repository/legacy/metadata/AbstractArtifactMetadata.java (edit) maven-core/src/main/java/org/apache/maven/artifact/repository/metadata/AbstractRepositoryMetadata.java (edit) maven-compat/src/main/java/org/apache/maven/repository/metadata/MetadataGraphVertex.java (edit) maven-core/src/main/java/org/apache/maven/project/MavenProject.java (edit) maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java (edit) maven-artifact/src/main/java/org/apache/maven/artifact/versioning/Restriction.java

            People

            • Assignee:
              michael-o Michael Osipov
              Reporter:
              alex.henrie Alex Henrie
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development