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

Jenkins warning categories don't sum to the displayed total

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-plugin
    • None
    • Jenkins ver. 1.656
      Warnings plugin 4.56

      At the current point, one of our builds shows the following warning statistics under Categories:

      • Cast: 194
      • Deprecation: 4953
      • Overloads: 3
      • Proprietary API: 19
      • Rawtypes: 480
      • Try: 74
      • Unchecked: 712
      • Varargs: 9
      • Total: 18298

      194 + 4953 + 3 + 19 + 480 + 74 + 712 + 9 ≠ 18298

          [JENKINS-38557] Jenkins warning categories don't sum to the displayed total

          Ulli Hafner added a comment - - edited

          Which parser is used? Is it possible that some warnings do not have a category?

          Ulli Hafner added a comment - - edited Which parser is used? Is it possible that some warnings do not have a category?

          trejkaz added a comment -

          This is the Javac parser. And I don't know. I would hope that if it is possible for a warning not to have a category, that Jenkins would report that number, so that I can add all the numbers up and get a consistent result.

          trejkaz added a comment - This is the Javac parser. And I don't know. I would hope that if it is possible for a warning not to have a category, that Jenkins would report that number, so that I can add all the numbers up and get a consistent result.

          Ulli Hafner added a comment -

          Do you have a log file that I can use for a test?

          Ulli Hafner added a comment - Do you have a log file that I can use for a test?

          trejkaz added a comment -

          Hmm, not one which I'll be allowed to post.

          I can provide extracts which might be relevant but I have to manually censor them.

          /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/itemtype/ItemTypeUtils.java:25: warning: no comment
              private static final Predicate<MimeType> activeMimeTypePredicate = mimeType -> {
                                                                                 ^
          /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/itemtype/ItemTypeUtils.java:26: warning: no comment
                  for (SupportedLevelInfo supportLevel : mimeType.getSupportLevel())
                                          ^
          /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/processor/DefaultProcessor.java:332: warning: [deprecation] exists(Path,LinkOption...) in FileUtils has been deprecated
                      if (com.acme.common.io.FileUtils.exists(persistentDir))
                                                      ^
          /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/processor/DefaultProcessor.java:591: warning: [unchecked] unchecked cast
                  container.setCustomMetadata((Map<String, String>) normalisedMap.get("customMetadata"));
                                                                                     ^
            required: Map<String,String>
            found:    Object
          /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/processor/DefaultProcessor.java:631: warning: [deprecation] incorrectCollator() in Collators has been deprecated
                      if (Collators.incorrectCollator().compare(existingContainer.getName(), evidenceContainer.getName()) == 0)
                                   ^
          /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/processor/DefaultProcessor.java:646: warning: [deprecation] incorrectCollator() in Collators has been deprecated
                      if (Collators.incorrectCollator().compare(container.getName(), evidenceContainer.getName()) == 0)
                                   ^
          /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/processor/DefaultProcessor.java:835: warning: [rawtypes] found raw type: SyncDifference
                      public void changeDetected(SyncDifference syncDifference)
          

          I am guessing these lines with nothing in square brackets are the ones with no category?

          trejkaz added a comment - Hmm, not one which I'll be allowed to post. I can provide extracts which might be relevant but I have to manually censor them. /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/itemtype/ItemTypeUtils.java:25: warning: no comment private static final Predicate<MimeType> activeMimeTypePredicate = mimeType -> { ^ /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/itemtype/ItemTypeUtils.java:26: warning: no comment for (SupportedLevelInfo supportLevel : mimeType.getSupportLevel()) ^ /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/processor/DefaultProcessor.java:332: warning: [deprecation] exists(Path,LinkOption...) in FileUtils has been deprecated if (com.acme.common.io.FileUtils.exists(persistentDir)) ^ /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/processor/DefaultProcessor.java:591: warning: [unchecked] unchecked cast container.setCustomMetadata((Map<String, String>) normalisedMap.get("customMetadata")); ^ required: Map<String,String> found: Object /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/processor/DefaultProcessor.java:631: warning: [deprecation] incorrectCollator() in Collators has been deprecated if (Collators.incorrectCollator().compare(existingContainer.getName(), evidenceContainer.getName()) == 0) ^ /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/processor/DefaultProcessor.java:646: warning: [deprecation] incorrectCollator() in Collators has been deprecated if (Collators.incorrectCollator().compare(container.getName(), evidenceContainer.getName()) == 0) ^ /opt/jenkins/jobs/trunk-compile/workspace/my-module/src/java/com/acme/script/impl/processor/DefaultProcessor.java:835: warning: [rawtypes] found raw type: SyncDifference public void changeDetected(SyncDifference syncDifference) I am guessing these lines with nothing in square brackets are the ones with no category?

          Ulli Hafner added a comment -

          Ok, thanks that is sufficient to reproduce the bug!

          Is it ok to use the string "-" as empty category in the UI? Or do you have a better idea?

          Ulli Hafner added a comment - Ok, thanks that is sufficient to reproduce the bug! Is it ok to use the string "-" as empty category in the UI? Or do you have a better idea?

          trejkaz added a comment -

          I think it's probably fine. Something like (no category) would probably be ideal, but I don't know how Jenkins is for localisations.

          trejkaz added a comment - I think it's probably fine. Something like (no category) would probably be ideal, but I don't know how Jenkins is for localisations.

          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/f210dee1f6f77ca485bf695376f330e997dc3505
          Log:
          [FIXED JENKINS-38557] Don' use an empty category or type anymore.

          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/f210dee1f6f77ca485bf695376f330e997dc3505 Log: [FIXED JENKINS-38557] Don' use an empty category or type anymore.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          pom.xml
          src/test/java/hudson/plugins/warnings/parser/AbstractEclipseParserTest.java
          src/test/java/hudson/plugins/warnings/parser/AcuCobolParserTest.java
          src/test/java/hudson/plugins/warnings/parser/AjcParserTest.java
          src/test/java/hudson/plugins/warnings/parser/AntJavacParserTest.java
          src/test/java/hudson/plugins/warnings/parser/Armcc5CompilerParserTest.java
          src/test/java/hudson/plugins/warnings/parser/ArmccCompilerParserTest.java
          src/test/java/hudson/plugins/warnings/parser/BuckminsterParserTest.java
          src/test/java/hudson/plugins/warnings/parser/ClangParserTest.java
          src/test/java/hudson/plugins/warnings/parser/CoolfluxChessccParserTest.java
          src/test/java/hudson/plugins/warnings/parser/DoxygenParserTest.java
          src/test/java/hudson/plugins/warnings/parser/EclipseParserTest.java
          src/test/java/hudson/plugins/warnings/parser/FlexSDKParserTest.java
          src/test/java/hudson/plugins/warnings/parser/GoLintParserTest.java
          src/test/java/hudson/plugins/warnings/parser/GoVetParserTest.java
          src/test/java/hudson/plugins/warnings/parser/JavaDocParserTest.java
          src/test/java/hudson/plugins/warnings/parser/JavacParserTest.java
          src/test/java/hudson/plugins/warnings/parser/ParserRegistryIntegrationTest.java
          src/test/java/hudson/plugins/warnings/parser/ParserTester.java
          src/test/java/hudson/plugins/warnings/parser/SbtScalacParserTest.java
          src/test/java/hudson/plugins/warnings/parser/SunCParserTest.java
          src/test/java/hudson/plugins/warnings/parser/TiCcsParserTest.java
          src/test/resources/hudson/plugins/warnings/parser/issue38557.txt
          warnings.iml
          http://jenkins-ci.org/commit/warnings-plugin/ec25a5f01a868eef89f43094d69578b50c69400e
          Log:
          [FIXED JENKINS-38557] Don' use an empty category or type anymore.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: pom.xml src/test/java/hudson/plugins/warnings/parser/AbstractEclipseParserTest.java src/test/java/hudson/plugins/warnings/parser/AcuCobolParserTest.java src/test/java/hudson/plugins/warnings/parser/AjcParserTest.java src/test/java/hudson/plugins/warnings/parser/AntJavacParserTest.java src/test/java/hudson/plugins/warnings/parser/Armcc5CompilerParserTest.java src/test/java/hudson/plugins/warnings/parser/ArmccCompilerParserTest.java src/test/java/hudson/plugins/warnings/parser/BuckminsterParserTest.java src/test/java/hudson/plugins/warnings/parser/ClangParserTest.java src/test/java/hudson/plugins/warnings/parser/CoolfluxChessccParserTest.java src/test/java/hudson/plugins/warnings/parser/DoxygenParserTest.java src/test/java/hudson/plugins/warnings/parser/EclipseParserTest.java src/test/java/hudson/plugins/warnings/parser/FlexSDKParserTest.java src/test/java/hudson/plugins/warnings/parser/GoLintParserTest.java src/test/java/hudson/plugins/warnings/parser/GoVetParserTest.java src/test/java/hudson/plugins/warnings/parser/JavaDocParserTest.java src/test/java/hudson/plugins/warnings/parser/JavacParserTest.java src/test/java/hudson/plugins/warnings/parser/ParserRegistryIntegrationTest.java src/test/java/hudson/plugins/warnings/parser/ParserTester.java src/test/java/hudson/plugins/warnings/parser/SbtScalacParserTest.java src/test/java/hudson/plugins/warnings/parser/SunCParserTest.java src/test/java/hudson/plugins/warnings/parser/TiCcsParserTest.java src/test/resources/hudson/plugins/warnings/parser/issue38557.txt warnings.iml http://jenkins-ci.org/commit/warnings-plugin/ec25a5f01a868eef89f43094d69578b50c69400e Log: [FIXED JENKINS-38557] Don' use an empty category or type anymore.

          Ulli Hafner added a comment - - edited

          This still can be localized in the UI. I'll add that later on.

          Ulli Hafner added a comment - - edited This still can be localized in the UI. I'll add that later on.

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/resources/hudson/plugins/analysis/views/TabDetail/categories.jelly
          src/main/resources/hudson/plugins/analysis/views/TabDetail/categories.properties
          src/main/resources/hudson/plugins/analysis/views/TabDetail/categories_de.properties
          src/main/resources/hudson/plugins/analysis/views/TabDetail/types.jelly
          src/main/resources/hudson/plugins/analysis/views/TabDetail/types.properties
          src/main/resources/hudson/plugins/analysis/views/TabDetail/types_de.properties
          http://jenkins-ci.org/commit/analysis-core-plugin/a2a98c51ce7e45f5ddffe5d773a7982bd53ddd43
          Log:
          JENKINS-38557 Localized empty category and type.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/resources/hudson/plugins/analysis/views/TabDetail/categories.jelly src/main/resources/hudson/plugins/analysis/views/TabDetail/categories.properties src/main/resources/hudson/plugins/analysis/views/TabDetail/categories_de.properties src/main/resources/hudson/plugins/analysis/views/TabDetail/types.jelly src/main/resources/hudson/plugins/analysis/views/TabDetail/types.properties src/main/resources/hudson/plugins/analysis/views/TabDetail/types_de.properties http://jenkins-ci.org/commit/analysis-core-plugin/a2a98c51ce7e45f5ddffe5d773a7982bd53ddd43 Log: JENKINS-38557 Localized empty category and type.

            drulli Ulli Hafner
            trejkaz trejkaz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: