Do not throw exception when Y-axis min/max properties are not set#62
Conversation
Silent the DoubleFromString conversion exception (INFO --> FINE) It is a feature not to configure YaxisMinimum/Maximum. In that case, String values are defaulted to null. As DoubleFromString convertion is called also within hasYaxisMinimum() / hasYaxisMaximum() function (strange pattern), so convertion failure is a feature and should not raise an exception with INFO level, which is bloating Jenkins logs
Codecov Report
@@ Coverage Diff @@
## master #62 +/- ##
=========================================
Coverage 43.38% 43.38%
Complexity 190 190
=========================================
Files 18 18
Lines 1263 1263
Branches 192 192
=========================================
Hits 548 548
Misses 651 651
Partials 64 64
Continue to review full report at Codecov.
|
| result = Double.parseDouble(input); | ||
| } catch (NumberFormatException nfe) { | ||
| LOGGER.log(Level.INFO, "Failed to parse Double value from String." | ||
| LOGGER.log(Level.FINE, "Failed to parse Double value from String." |
There was a problem hiding this comment.
@gjabouley-invn hey. have you tried actually adjusting the logic and properly verifying the input for emptiness? That was suggest in the ticket as well and looks legit.
There was a problem hiding this comment.
I've made corresponding change, it should now be aligned with your expectations
Leveraging StringUtils.IsEmty() which handles null gracefully
|
Thanks a lot for your contribution @gjabouley-invn. This change will be included in 2.1.8 version which was just released. 🎉 🎉 🎉 |
Jira: JENKINS-50363
Fix the GetDoubleFromString conversion exception (INFO --> FINE) when YaxisMin/Max are not set
It is a feature not to configure YaxisMinimum/Maximum. In that case, String values are defaulted to null.
As DoubleFromString convertion is called also within hasYaxisMinimum() / hasYaxisMaximum() function (strange pattern), so convertion failure is a feature and should not raise an exception with INFO level, which is bloating Jenkins logs