[JIRA] (JENKINS-57428) Duplicate warnings when using error-prone and java scan

16 views
Skip to first unread message

reitzmichnicht@gmx.de (JIRA)

unread,
May 13, 2019, 8:18:03 AM5/13/19
to jenkinsc...@googlegroups.com
Michael Düsterhus created an issue
 
Jenkins / Bug JENKINS-57428
Duplicate warnings when using error-prone and java scan
Issue Type: Bug Bug
Assignee: Ulli Hafner
Attachments: 2019-05-13 14_14_43- [Jenkins] - Vivaldi.png, 2019-05-13 14_16_36-[Jenkins] - Vivaldi.png
Components: analysis-model
Created: 2019-05-13 12:17
Environment: Version 5.0.1
Priority: Minor Minor
Reporter: Michael Düsterhus

We use the following setup to scan for java and error-prone warnings:

 def javaIssues = scanForIssues(
                        blameDisabled: !blame,
                        sourceCodeEncoding: 'UTF-8',
                        tool: java(reportEncoding: 'UTF-8'))
                def errorproneIssues = scanForIssues(
                        blameDisabled: !blame,
                        sourceCodeEncoding: 'UTF-8',
                        tool: errorProne(reportEncoding: 'UTF-8'))
                publishIssues(
                        id: 'java-compiler',
                        name: 'Compiler',
                        ignoreFailedBuilds: false,
                        sourceCodeEncoding: 'UTF-8',
                        issues: [javaIssues, errorproneIssues],
                        qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]])

For a build output like this it results in duplicate warnings count:

00:03:20.475  [WARNING] /home/jenkins/agent/workspace/xxx/src/test/java/foo/SettingsControllerIT.java:[139,57] [StringSplitter] String.split(String) has surprising behavior
00:03:20.475      (see https://errorprone.info/bugpattern/StringSplitter)
00:03:20.475    Did you mean 'for (String productFamStr : Splitter.on(',').split(productFamiliesStr)) {'?

See screenshot

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

ullrich.hafner@gmail.com (JIRA)

unread,
May 13, 2019, 4:59:02 PM5/13/19
to jenkinsc...@googlegroups.com
Ulli Hafner commented on Bug JENKINS-57428
 
Re: Duplicate warnings when using error-prone and java scan

Yes, both parsers match the same warning line. Just error prone has some additional entries. I'm not sure what a good approach would be to eliminate these duplicates.

ullrich.hafner@gmail.com (JIRA)

unread,
May 13, 2019, 4:59:04 PM5/13/19
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
 
Jenkins / Improvement JENKINS-57428
Change By: Ulli Hafner
Issue Type: Bug Improvement

reitzmichnicht@gmx.de (JIRA)

unread,
May 14, 2019, 3:33:02 AM5/14/19
to jenkinsc...@googlegroups.com
Michael Düsterhus commented on Improvement JENKINS-57428
 
Re: Duplicate warnings when using error-prone and java scan

I would recommend to define priority for parsers and put all warnings with unique identifier like (File + Line) in a global HashMap. Then if a parser has already created a warnings entry for this location all subsequent parsers will ignore it.

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 20, 2019, 5:05:02 AM9/20/19
to jenkinsc...@googlegroups.com
Ulli Hafner assigned an issue to Unassigned
 
Change By: Ulli Hafner
Assignee: Ulli Hafner
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 20, 2019, 5:05:02 AM9/20/19
to jenkinsc...@googlegroups.com
Ulli Hafner updated an issue
Change By: Ulli Hafner
Labels: help-wanted newbie-friendly

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 20, 2019, 5:13:02 AM9/20/19
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Sep 20, 2019, 5:13:02 AM9/20/19
to jenkinsc...@googlegroups.com

andipabst25@gmail.com (JIRA)

unread,
Oct 16, 2019, 12:07:02 PM10/16/19
to jenkinsc...@googlegroups.com

ullrich.hafner@gmail.com (JIRA)

unread,
Oct 17, 2019, 5:10:02 PM10/17/19
to jenkinsc...@googlegroups.com
Change By: Ulli Hafner
Status: Open Fixed but Unreleased
Resolution: Fixed

ullrich.hafner@gmail.com (JIRA)

unread,
Oct 23, 2019, 4:52:05 AM10/23/19
to jenkinsc...@googlegroups.com
Change By: Ulli Hafner
Status: Fixed but Unreleased Resolved
Released As: 7.0.0
Reply all
Reply to author
Forward
0 new messages