Project

General

Profile

bug #7578

Updated by Andreas Kohlbecker almost 6 years ago

as reported in #6563 the double values which are `null` are serialized as `0.0` by json-lib this is plain wrong for all measurments like those in `GatheringEvent` 

 This affect the following model class properties: 

 **Double and Float:** 

 * location.Point.java (3 matches) 
     * 70: private Double longitude;  
     * 75: private Double latitude;  
     * 382: private Double toDecimal(){  
 * molecular.Amplification.java (3 matches) 
     * 150: private Double electrophoresisVoltage;  
     * 156: private Double gelRunningTime;  
     * 162: private Double gelConcentration;  
 * molecular.AmplificationResult.java 
     * 143: // private Double gelRunningTime;  
 * molecular.DnaQuality.java (3 matches) 
     * 93: private Double ratioOfAbsorbance260_230;  
     * 95: private Double ratioOfAbsorbance260_280;  
     * 97: private Double concentration;  
 * occurrence.GatheringEvent.java (4 matches) 
     * 153: private Double distanceToGround;  
     * 159: private Double distanceToGroundMax;  
     * 179: private Double distanceToWaterSurface;  
     * 185: private Double distanceToWaterSurfaceMax;  
 * PreservationMethod.java 
     * 71: private Double temperature;   
 * description.StatisticalMeasurementValue.java 
     * 62: private float value;  

 **Integer** 

 * description.FeatureNode.java 
     * ~~120: 120: private Integer sortIndex;~~ - value not used 
 sortIndex;  
 * description.PolytomousKeyNode.java (2 matches) 
     * ~~190: 190: private Integer sortIndex = -1;~~ - value not used 
     -1;  
     * 237: private Integer nodeNumber = null;  
 * description.QuantitativeData.java 
     * ~~112: 112: // private Integer sampleSize;~~ 
 sampleSize;  
 * locationPoint.java 
     * 83: private Integer errorRadius = 0; - 0 by default, can be set to null in which case serialization as null would be ok  
 * media.ExternalLink.java 
     * 97: private Integer size; - can be null and should be serialized as null in this case 
  
 * media.MediaRepresentationPart.java 
     * 61: private Integer size; - should be serialized as null is size is unknown 
   
 molecular.SequenceString.java 
     * 56: private Integer length;    - should be serialized as null is length is unknown 
   
 * molecular.SingleReadAlignment.java (3 matches) 
     * 67: private Integer firstSeqPosition;    - null serialization ok 
       
     * 69: private Integer leftCutPosition;     - null serialization ok  
       
     * 71: private Integer rightCutPosition;     - null serialization ok  
   
 * name.TaxonName.java (2 matches) 
     * 564: private Integer publicationYear;     - null serialization ok 
      
     * 570: private Integer originalPublicationYear;      - null serialization ok 
  
 * occurrence.GatheringEvent.java (2 matches) 
     * 127: private Integer absoluteElevation;     - null serialization ok 
      
     * 133: private Integer absoluteElevationMax;     - null serialization ok 
  
 * taxon.TaxonComparator.java 
     * 191: private Integer getIntegerDate(TaxonName name){  
 * taxon.TaxonNode.java 
     * 145: private Integer sortIndex = -1; -- for internal use only not expected to be null at any time 


 according to the above analysis all Integer, Double and Float values should be serialized as null if the value is null.  

 

Back