tomasbjerre / violations-lib

Java library for parsing report files from static code analysis.
Apache License 2.0
148 stars 39 forks source link

NoSuchElementException when parsing JUnit report without type #97

Closed uhafner closed 4 years ago

uhafner commented 4 years ago

The JUnit parser accesses an optional without guard (if neither message or type is filled).

final String message = messageOpt.orElse(findAttribute(failure, "type").get());

See original bug report in https://issues.jenkins-ci.org/browse/JENKINS-63527. There is also https://github.com/jenkinsci/analysis-model/pull/500 that exposes the bug

tomasbjerre commented 4 years ago

Thanks for reporting. Released a fix in 1.122.

uhafner commented 4 years ago

Thanks for fixing so fast!