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
DRM-09 : startOfPeriod and endOfPeriod not there exception should be handled properly #61
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -444,8 +444,16 @@ AdxType getAdxType( DataValueSet dvs, String timeperiod ) | |
{ | ||
DataValueType dvtype = new DataValueType(); | ||
dvtype.setDataElement( dv.getDataElement() ); | ||
dvtype.setValue( new BigDecimal( dv.getValue() ) ); | ||
try | ||
{ | ||
BigDecimal bd = new BigDecimal( dv.getValue() ); | ||
dvtype.setValue( bd ); | ||
dvTypeList.add( dvtype ); | ||
} | ||
catch ( NumberFormatException e ) | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not recommended to catch exceptions and do nothing. You would rather leave them to bubble through. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You seem to have nothing to do in the exception handler. Can't you just remove the try and catch to let it bubble up? |
||
dvTypeList.add( null ); | ||
} | ||
} | ||
gt.getDataValue().addAll( dvTypeList ); | ||
gt.setOrgUnit( dvs.getOrgUnit() ); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some unit tests for these changes?