-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Platform: All, OS: Linux
During rcov report parsing, rubyMetrics threw a NumberFormatException. It was in
RcovAbstractResult.getTotalCoverageFloat - totalCoverage was " ", and after it
was trimmed it was an empty string, causing FloatingDecimal.readJavaFormatString
to throw the exception. Here's the top of the stack trace:
Publishing rcov report...
FATAL: empty String
java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:994)
at java.lang.Float.valueOf(Float.java:388)
at
hudson.plugins.rubyMetrics.rcov.model.RcovAbstractResult.getTotalCoverageFloat(RcovAbstractResult.java:37)
at
hudson.plugins.rubyMetrics.rcov.model.RcovResult.getRatioFloat(RcovResult.java:36)
at
hudson.plugins.rubyMetrics.rcov.RcovPublisher.failMetrics(RcovPublisher.java:70)
at hudson.plugins.rubyMetrics.rcov.RcovPublisher.perform(RcovPublisher.java:58)
The rcov report was generated in an interesting way, and this was the table cell
the HTML parser was running into:
<td class='lines_total'> <tt> 2363 </tt> </td>
As you can see, there were spaces padding every tag. This meant that inside
<tt>, there were three text nodes, " ", "2363", and " ". RcovParser just grabs
the first text node and runs with it.
Found this issue on both Ubuntu 9.04 and RHEL 5.3.