fixedformat4j
fixedformat4j copied to clipboard
Loading and exporting records with numeric fields with empty strings to read is not consistent
What steps will reproduce the problem?
1. Load a record with a numeric field and an empty string to read.
2. Export the same record
3. Compare the two strings
What is the expected output? What do you see instead?
Since there is no data to be read, I would expect the numeric variables to be
null and not zero. When I export the same records, I find zeros where there was
none in the initial data. There is no way to differenciate no data from zeros.
What version of the product are you using? On what Java version?
fixedformat4j 1.3.4, java 1.6
Please provide any additional information below.
The problem comes from the remove functions in the sign enum.
if (StringUtils.isEmpty(result)) {
result = "0";
}
Original issue reported on code.google.com by [email protected] on 8 Aug 2011 at 6:00
please see my works on https://github.com/ty-vincenthung/fixedformatter4j/tree/1.0-snapshot