problem with 'Avoid Hiding Cause of the Exception': if exception passed as not last parameter to c-tor #52

Closed
romani opened this Issue Sep 20, 2012 · 2 comments

Projects

None yet

2 participants

@romani
Member
romani commented Sep 20, 2012

Code:

@Override
public Object convertToObject(String newString, Object previousValue)
throws DataTypeConversionException {
if (BigDecimal.class.equals(type)) { // fix for #279
DecimalFormat format = (DecimalFormat) NumberFormat.getNumberInstance(getLocale());
format.setParseBigDecimal(true);
try {
return format.parse(newString);
} catch (ParseException e) {
ErrorObject errorCode = new ErrorObject(ErrorCodes.ERROR_CODE_BAD_FORMAT, newString);
throw new DataTypeConversionException("Could not be converted to BigDecimal", e, errorCode); //// INCORRECT WARNING HERE!!
}
}
return convertType(super.convertToObject(newString, previousValue));
}

Please update Uts as support this case.

@romani
Member
romani commented Oct 5, 2012

Issue is assigned to Ilja Dubinin (https://github.com/sabaka).

@sabaka sabaka was assigned Oct 7, 2012
@sabaka sabaka pushed a commit to sabaka/sevntu.checkstyle that referenced this issue Mar 2, 2013
sabaka Issue #52 fixed 102aa40
@sabaka sabaka pushed a commit to sabaka/sevntu.checkstyle that referenced this issue Mar 8, 2013
sabaka Issue #52 fixed b40cefa
@romani
Member
romani commented Mar 11, 2013

fixed

@romani romani closed this Mar 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment