Project

General

Profile

« Previous | Next » 

Revision c1ea474d

Added by Andreas Müller almost 4 years 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