Task Number fields not saved to file if the value would floor to zero
Multi platform library to read and write schedule data
Brought to you by:
joniles
The method writeExtendedAttribute in class MSPDIWriter checks if NUMERIC values of fields are zero, and if returns false so the caller does not write the field to the file.
The problem that the test uses the intValue method of Number, which for a Double returns 0 if the value is less than 1.0. Therefore, and field value (like task Number fields) that floor to zero are not written.
I expect the fix is change this line in MSPDIWriter.java
write = (((Number) value).intValue() != 0);
to
write = (((Number) value).doubleValue() != 0.0);
Thanks for raising this. The code now in Git fixes this issue.