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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: pmd-plugin
    • Labels:
      None
    • Similar Issues:
      Show 5 results

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            drulli 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.

            Show
            drulli 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.
            Hide
            scm_issue_link 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.

            Show
            scm_issue_link 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.
            Hide
            scm_issue_link 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.

            Show
            scm_issue_link 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.
            Hide
            dogfood 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
            Show
            dogfood 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
            Hide
            dogfood dogfood added a comment -

            Integrated in plugins_pmd #311

            Result = SUCCESS

            Show
            dogfood dogfood added a comment - Integrated in plugins_pmd #311 Result = SUCCESS
            Hide
            drulli 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

            Show
            drulli 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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: