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

Error when processing coverage reports containing a big number of hits #65

Closed
wenns opened this issue Nov 15, 2013 · 2 comments
Closed
Assignees
Labels

Comments

@wenns
Copy link
Contributor

wenns commented Nov 15, 2013

With in the Coverage analysis module, parsing a "hit" element that exceeds a _int32 size will cause failures, and emits no useful message.
This is crippling on projects with large code base since the hit count for many central functions can rapidly exceed 2^31.
In my case an accurate hit count is not required, so truncation would be acceptable.
03:03:28.915 INFO - Parsing report '/Sonar_Test_coverage/software/coverage-reports/coverage-unit.xml'
INFO: ----------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 38:42.225s
INFO: Final Memory: 25M/2087M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: For input string: "2806720497"
ERROR:

@ghost ghost assigned wenns Nov 15, 2013
@wenns wenns closed this as completed Nov 15, 2013
@brunocrt
Copy link

Hi wenns, could you please provide how did you fix this issue?

@wenns
Copy link
Contributor Author

wenns commented Mar 30, 2015

This was fixed by commit fb3aa88:

long noHits = Long.parseLong(line.getAttrValue("hits"));
if(noHits > Integer.MAX_VALUE){
        CxxUtils.LOG.warn("Truncating the actual number of hits ({}) to the maximum number supported by Sonar ({})",
                          noHits, Integer.MAX_VALUE);
        noHits = Integer.MAX_VALUE;
}
builder.setHits(lineId, (int)noHits);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants