Skip to content
Snippets Groups Projects
Commit 92a2f586 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Make sure decimal separator correctly set

parent 2db7e947
No related branches found
No related tags found
No related merge requests found
Pipeline #7658 canceled
......@@ -178,16 +178,16 @@ public class JsonAttributeParser<T extends Object> {
return (T)attributeValue;
case INTEGER:
try {
Number result = decimalFormat.parse(attributeValue);
return (T)new Integer(result.intValue());
} catch (ParseException e) {
int result = Integer.parseInt(attributeValue);
return (T)new Integer(result);
} catch (NumberFormatException e) {
throw new TechnicalException(String.format("Error while parsing json numeric value, for attribute [%s]: %s", attributeName,e.getMessage()), e);
}
case LONG:
try {
Number result = decimalFormat.parse(attributeValue);
return (T)new Long(result.longValue());
} catch (ParseException e) {
long result = Long.parseLong(attributeValue);
return (T)new Long(result);
} catch (NumberFormatException e) {
throw new TechnicalException(String.format("Error while parsing json numeric value, for attribute [%s]: %s", attributeName,e.getMessage()), e);
}
case DOUBLE:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment