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

Incorrect compareTo method

    XMLWordPrintable

Details

    Description

      Current compareTo implementation inside AbstractAnnotation assumes that each line of code have just one annotation which is not always true. If that happens exception during sorting is thrown. Method can be overriden to use also e.g. annotation message and key but it would be best to use the column numbers which are unavailable for derived classes.

      Attachments

        Activity

          drulli Ulli Hafner added a comment -

          Integrated in Jenkins Analysis Plug-ins (Compile) #609
          [FIXED JENKINS-19047] Also use column position when comparing warnings. (Revision 8f00f2572e411591da0fc9e1f7b093543caaa253)
          JENKINS-19047 Make column part of public API of FileAnnotation. (Revision c4b4da266808e8bf4a3609960764f183ddc67a53)

          Result = SUCCESS

          drulli Ulli Hafner added a comment - Integrated in Jenkins Analysis Plug-ins (Compile) #609 [FIXED JENKINS-19047] Also use column position when comparing warnings. (Revision 8f00f2572e411591da0fc9e1f7b093543caaa253) JENKINS-19047 Make column part of public API of FileAnnotation. (Revision c4b4da266808e8bf4a3609960764f183ddc67a53) Result = SUCCESS

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/warnings/parser/ClangParser.java
          src/main/java/hudson/plugins/warnings/parser/Gcc4CompilerParser.java
          src/main/java/hudson/plugins/warnings/parser/IntelCParser.java
          src/main/java/hudson/plugins/warnings/parser/JavacParser.java
          src/main/java/hudson/plugins/warnings/parser/MsBuildParser.java
          src/main/java/hudson/plugins/warnings/parser/Pep8Parser.java
          src/test/java/hudson/plugins/warnings/parser/ClangParserTest.java
          src/test/java/hudson/plugins/warnings/parser/Gcc4CompilerParserTest.java
          src/test/java/hudson/plugins/warnings/parser/IntelCParserTest.java
          src/test/java/hudson/plugins/warnings/parser/JavacParserTest.java
          src/test/java/hudson/plugins/warnings/parser/MsBuildParserTest.java
          src/test/java/hudson/plugins/warnings/parser/Pep8ParserTest.java
          src/test/java/hudson/plugins/warnings/parser/PerlCriticParserTest.java
          http://jenkins-ci.org/commit/warnings-plugin/c11874ad9fa96a87891c031b07c1e8ce2bd85728
          Log:
          JENKINS-19047 Use column position in parsers when available.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/warnings/parser/ClangParser.java src/main/java/hudson/plugins/warnings/parser/Gcc4CompilerParser.java src/main/java/hudson/plugins/warnings/parser/IntelCParser.java src/main/java/hudson/plugins/warnings/parser/JavacParser.java src/main/java/hudson/plugins/warnings/parser/MsBuildParser.java src/main/java/hudson/plugins/warnings/parser/Pep8Parser.java src/test/java/hudson/plugins/warnings/parser/ClangParserTest.java src/test/java/hudson/plugins/warnings/parser/Gcc4CompilerParserTest.java src/test/java/hudson/plugins/warnings/parser/IntelCParserTest.java src/test/java/hudson/plugins/warnings/parser/JavacParserTest.java src/test/java/hudson/plugins/warnings/parser/MsBuildParserTest.java src/test/java/hudson/plugins/warnings/parser/Pep8ParserTest.java src/test/java/hudson/plugins/warnings/parser/PerlCriticParserTest.java http://jenkins-ci.org/commit/warnings-plugin/c11874ad9fa96a87891c031b07c1e8ce2bd85728 Log: JENKINS-19047 Use column position in parsers when available.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/util/model/AbstractAnnotation.java
          src/main/java/hudson/plugins/analysis/util/model/FileAnnotation.java
          src/test/java/hudson/plugins/analysis/util/model/AbstractAnnotationTest.java
          http://jenkins-ci.org/commit/analysis-core-plugin/c4b4da266808e8bf4a3609960764f183ddc67a53
          Log:
          JENKINS-19047 Make column part of public API of FileAnnotation.

          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 src/main/java/hudson/plugins/analysis/util/model/FileAnnotation.java src/test/java/hudson/plugins/analysis/util/model/AbstractAnnotationTest.java http://jenkins-ci.org/commit/analysis-core-plugin/c4b4da266808e8bf4a3609960764f183ddc67a53 Log: JENKINS-19047 Make column part of public API of FileAnnotation.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          .gitignore
          src/main/java/hudson/plugins/analysis/util/model/AbstractAnnotation.java
          src/test/java/hudson/plugins/analysis/util/model/AbstractAnnotationTest.java
          http://jenkins-ci.org/commit/analysis-core-plugin/8f00f2572e411591da0fc9e1f7b093543caaa253
          Log:
          [FIXED JENKINS-19047] Also use column position when comparing warnings.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: .gitignore src/main/java/hudson/plugins/analysis/util/model/AbstractAnnotation.java src/test/java/hudson/plugins/analysis/util/model/AbstractAnnotationTest.java http://jenkins-ci.org/commit/analysis-core-plugin/8f00f2572e411591da0fc9e1f7b093543caaa253 Log: [FIXED JENKINS-19047] Also use column position when comparing warnings.
          drulli Ulli Hafner added a comment -

          It would be good if also all existing parsers would be checked to see if they correctly assign the column number for a warning.

          drulli Ulli Hafner added a comment - It would be good if also all existing parsers would be checked to see if they correctly assign the column number for a warning.

          People

            drulli Ulli Hafner
            dpapierniak Dariusz Papierniak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: