Skip to content
Snippets Groups Projects
Commit 8d69d611 authored by Bernhard Johannes Berger's avatar Bernhard Johannes Berger
Browse files

Added an explicit conversion to double in the CSV import to force numbers to be of correct type.

parent c7e1b4e3
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ public class CSVPropertiesReader implements PropertiesReader {
@Override
public PropertiesReader init(final File inputFile, final PropertiesSpecification specification) throws EvoalIOException {
log.info("Creating JSON properties reader for {}.", specification);
log.info("Creating CSV properties reader for {}.", specification);
this.specification = specification;
try {
......@@ -76,7 +76,7 @@ public class CSVPropertiesReader implements PropertiesReader {
final Object value = switch (((BaseDataDescription)s.type()).getRepresentation()) {
case BOOLEAN -> Boolean.parseBoolean(strValue);
case INTEGER -> "Infinity".equals(strValue) ? Integer.MAX_VALUE : nf.parse(strValue);
case REAL -> "Infinity".equals(strValue) ? Double.POSITIVE_INFINITY : nf.parse(strValue);
case REAL -> "Infinity".equals(strValue) ? Double.POSITIVE_INFINITY : nf.parse(strValue).doubleValue();
case STRING -> strValue;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment