Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-12801

When there are 2 PMD warnings on 1 line the Jenkins report does only report 1

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • pmd-plugin
    • None

      We have this line of code:

      public boolean hasNext()
      {
      	return cursor == EMPTY && entity != EMPTY;
      }
      

      PMD xml report has these violations reported:

      <violation beginline="216" endline="216" begincolumn="32" endcolumn="46" rule="CompareObjectsWithEquals" ruleset="Design Rules" package="com.myapplication.util.collections" class="SingleSet$SingleSetIterator" method="hasNext" externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#CompareObjectsWithEquals" priority="3">
      Use equals() to compare object references.
      </violation>
      <violation beginline="216" endline="216" begincolumn="51" endcolumn="65" rule="CompareObjectsWithEquals" ruleset="Design Rules" package="com.myapplication.util.collections" class="SingleSet$SingleSetIterator" method="hasNext" externalInfoUrl="http://pmd.sourceforge.net/rules/design.html#CompareObjectsWithEquals" priority="3">
      Use equals() to compare object references.
      </violation>
      

      Is reports 2 issues on the same line. Other begincolumn and other endcolumn.

      In the UI it is only reported once.
      And the total number of violations does not match with the actual number of violations.

          [JENKINS-12801] When there are 2 PMD warnings on 1 line the Jenkins report does only report 1

          Ulli Hafner added a comment -

          Yes, that is true. "Duplicate" warnings are currently detected using a simple equals method that does only consider type and line, but not the column.

          Ulli Hafner added a comment - Yes, that is true. "Duplicate" warnings are currently detected using a simple equals method that does only consider type and line, but not the column.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/util/model/AbstractAnnotation.java
          http://jenkins-ci.org/commit/analysis-core-plugin/5123f0efb7b7b2d9bb26c7970c4e2bd83791746a
          Log:
          JENKINS-12822 JENKINS-12801 Added support for columns in warnings.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/util/model/AbstractAnnotation.java http://jenkins-ci.org/commit/analysis-core-plugin/5123f0efb7b7b2d9bb26c7970c4e2bd83791746a Log: JENKINS-12822 JENKINS-12801 Added support for columns in warnings.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          .classpath
          pom.xml
          src/main/java/hudson/plugins/pmd/parser/PmdParser.java
          src/main/java/hudson/plugins/pmd/parser/Violation.java
          src/test/java/hudson/plugins/pmd/parser/PmdParserTest.java
          src/test/resources/hudson/plugins/pmd/parser/issue12801.xml
          http://jenkins-ci.org/commit/pmd-plugin/c311e09311092846081b0b37c6b175266059f660
          Log:
          [FIXED JENKINS-12801] Added column support for PMD warnings.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: .classpath pom.xml src/main/java/hudson/plugins/pmd/parser/PmdParser.java src/main/java/hudson/plugins/pmd/parser/Violation.java src/test/java/hudson/plugins/pmd/parser/PmdParserTest.java src/test/resources/hudson/plugins/pmd/parser/issue12801.xml http://jenkins-ci.org/commit/pmd-plugin/c311e09311092846081b0b37c6b175266059f660 Log: [FIXED JENKINS-12801] Added column support for PMD warnings.

          dogfood added a comment -

          Integrated in plugins_analysis-core #10411
          JENKINS-12822 JENKINS-12801 Added support for columns in warnings. (Revision 5123f0efb7b7b2d9bb26c7970c4e2bd83791746a)

          Result = SUCCESS
          Ulli Hafner :
          Files :

          • src/main/java/hudson/plugins/analysis/util/model/AbstractAnnotation.java

          dogfood added a comment - Integrated in plugins_analysis-core #10411 JENKINS-12822 JENKINS-12801 Added support for columns in warnings. (Revision 5123f0efb7b7b2d9bb26c7970c4e2bd83791746a) Result = SUCCESS Ulli Hafner : Files : src/main/java/hudson/plugins/analysis/util/model/AbstractAnnotation.java

          dogfood added a comment -

          Integrated in plugins_pmd #311

          Result = SUCCESS

          dogfood added a comment - Integrated in plugins_pmd #311 Result = SUCCESS

          Ulli Hafner added a comment -

          Integrated in Jenkins Analysis Plug-ins (Compile) #398
          JENKINS-12822 JENKINS-12801 Added support for columns in warnings. (Revision 5123f0efb7b7b2d9bb26c7970c4e2bd83791746a)

          Result = SUCCESS

          Ulli Hafner added a comment - Integrated in Jenkins Analysis Plug-ins (Compile) #398 JENKINS-12822 JENKINS-12801 Added support for columns in warnings. (Revision 5123f0efb7b7b2d9bb26c7970c4e2bd83791746a) Result = SUCCESS

            drulli Ulli Hafner
            cbos Cees Bos
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: