Project

General

Profile

Revision c1ea474d

IDc1ea474ddbb826ac5de39611e8dd30fce2f99699
Parent cd2dc972
Child 0510635b

Added by Andreas Müller 6 months ago

fix null handling in QuantitativeData.NewMinMaxInstance

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/QuantitativeData.java
138 138
     */
139 139
    public static QuantitativeData NewMinMaxInstance(Feature feature, BigDecimal min, BigDecimal max){
140 140
        QuantitativeData result = new QuantitativeData(feature);
141
        StatisticalMeasurementValue minValue = StatisticalMeasurementValue.NewInstance(StatisticalMeasure.MIN(),min);
142
        result.addStatisticalValue(minValue);
143
        StatisticalMeasurementValue maxValue = StatisticalMeasurementValue.NewInstance(StatisticalMeasure.MAX(), max);
144
        result.addStatisticalValue(maxValue);
141
        if (min != null){
142
            StatisticalMeasurementValue minValue = StatisticalMeasurementValue.NewInstance(StatisticalMeasure.MIN(),min);
143
            result.addStatisticalValue(minValue);
144
        }
145
        if (max != null){
146
            StatisticalMeasurementValue maxValue = StatisticalMeasurementValue.NewInstance(StatisticalMeasure.MAX(), max);
147
            result.addStatisticalValue(maxValue);
148
        }
145 149
        return result;
146 150
    }
147 151

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)