bug #7578
closedpreseve null values in all mesurements during serialization of webservice responses
100%
Description
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;
- 71: private Double temperature;
- description.StatisticalMeasurementValue.java
- 62: private float value;
Integer
- description.FeatureNode.java
120: private Integer sortIndex;- value not used
- description.PolytomousKeyNode.java (2 matches)
190: private Integer sortIndex = -1;- value not used- 237: private Integer nodeNumber = null;
- description.QuantitativeData.java
112: // private Integer 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.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.
Updated by Andreas Kohlbecker over 5 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 50
Applied in changeset cdmlib|d9f51acb041832197601f3343f4d3f6fd777b888.
Updated by Andreas Kohlbecker over 5 years ago
review by checking the example record here: http://test.e-taxonomy.eu/dataportal/preview/cichorieae/cdm_dataportal/taxon/1ad7630a-290b-464f-99e3-43c9dfb3c38b/specimens but this may be overwritten by importing a new production DB to test.
Updated by Andreas Müller over 5 years ago
- Subject changed from preseve null values in all mesurements during serializazion of webservice responses to preseve null values in all mesurements during serialization of webservice responses
Updated by Andreas Kohlbecker over 5 years ago
- Status changed from Resolved to In Progress
this seems to be not working as expected:
returns '0' for absoluteElevation
even if set to NULL
Updated by Andreas Kohlbecker over 5 years ago
- Status changed from In Progress to Closed
- % Done changed from 50 to 100
works now!
Updated by Andreas Müller over 5 years ago
error radius still returns 0 in http://test.e-taxonomy.eu/cdmserver/cichorieae/occurrence/8eaf2ade-d478-4af6-b3df-bad69f23ea3a/gatheringEvent.json
Is this wanted or excepted behavior?
Updated by Andreas Kohlbecker over 5 years ago
Andreas Müller wrote:
error radius still returns 0 in http://test.e-taxonomy.eu/cdmserver/cichorieae/occurrence/8eaf2ade-d478-4af6-b3df-bad69f23ea3a/gatheringEvent.json
Is this wanted or excepted behavior?
The actual value of radius in this case is 0
when I set it to NULL
the webservice returns NULL
It seems as if there is a problem with the embedded type Point. Whenever long and lat are set the radius is always set to 0
implying a precision of the location information which was not intended. It should be NULL instead.