Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-71687] Intellij IDEA Inspection causes Exception during Jenkins Job fix #934

Merged
merged 6 commits into from
Jul 26, 2023

Conversation

flashfishgit
Copy link

@flashfishgit flashfishgit commented Jul 25, 2023

This pull request was created regarding following issues:
https://issues.jenkins.io/browse/JENKINS-71687
also on
https://youtrack.jetbrains.com/issue/IDEA-325906/IDEA-Inspections-cause-Exception-during-Jenkins-Job

The Idea-Inspection of the new Idea-Versions doesn't return a line-number, which causes an Error in the parseInt function (For details see Issue JENKINS-71687) ->
So I made the issueBuilder.setLineStart(Integer.parseInt(getChildValue(element, "line"))); optional.

Testing done

I added a problem to the issue56235.xml, which gets tested in the IdeaInspectionParserTest.java.

Submitter checklist

@uhafner uhafner added the bug Bugs or performance problems label Jul 26, 2023
.setCategory(StringEscapeUtils.unescapeXml(getValue(problem)))
.setMessage(StringEscapeUtils.unescapeXml(getChildValue(element, "description")))
.setModuleName(StringEscapeUtils.unescapeXml(getChildValue(element, "module")))
.setSeverity(getPriority(problem.getAttribute("severity")));
if(!getChildValue(element, "line").equals("-")){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract the value into a local variable and reuse later

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be much simpler when you use IntegerParser.parseInt, then everything should work out of the box.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. As recommended I change the parser to IntegerParser.

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #934 (22f68a0) into master (dfd7bb9) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 22f68a0 differs from pull request most recent head f75ab99. Consider uploading reports for the commit f75ab99 to get more accurate results

@@            Coverage Diff            @@
##             master     #934   +/-   ##
=========================================
  Coverage     92.89%   92.89%           
  Complexity     2322     2322           
=========================================
  Files           341      341           
  Lines          6450     6450           
  Branches        669      669           
=========================================
  Hits           5992     5992           
  Misses          262      262           
  Partials        196      196           
Files Changed Coverage Δ
...m/hafner/analysis/parser/IdeaInspectionParser.java 88.23% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@uhafner uhafner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

@uhafner uhafner merged commit acec1b6 into jenkinsci:master Jul 26, 2023
4 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs or performance problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants