diff --git a/bds/source/java/ch/systemsx/cisd/bds/DataSet.java b/bds/source/java/ch/systemsx/cisd/bds/DataSet.java index f0e3055812ef18b9c91c8e5001bc3a8ba596ac23..5b2028d56feacf59810d93766abb8dac5fb0fa94 100644 --- a/bds/source/java/ch/systemsx/cisd/bds/DataSet.java +++ b/bds/source/java/ch/systemsx/cisd/bds/DataSet.java @@ -36,9 +36,6 @@ public final class DataSet implements IStorable static final String NO_PARENT_FOR_MEASURED_DATA = "No parent could be specified for measured data."; - static final String PARENT_FOR_DERIVED_DATA = - "At least one parent must be specified for derived data."; - static final String FOLDER = "data_set"; static final String CODE = "code"; @@ -105,21 +102,12 @@ public final class DataSet implements IStorable this.isMeasured = isMeasured; assert StringUtils.isEmpty(observableType) == false : "Unspecified observable type."; this.observableTypeCode = observableType; - if (isMeasured == false) - { - if (parentCodesOrNull == null || parentCodesOrNull.size() == 0) - { - throw new IllegalArgumentException(PARENT_FOR_DERIVED_DATA); - } - this.parentCodes = parentCodesOrNull; - } else + if (isMeasured == true && parentCodesOrNull != null && parentCodesOrNull.size() > 0) { - if (parentCodesOrNull != null && parentCodesOrNull.size() > 0) - { - throw new IllegalArgumentException(String.format(NO_PARENT_FOR_MEASURED_DATA)); - } - this.parentCodes = Collections.<String> emptyList(); + throw new IllegalArgumentException(String.format(NO_PARENT_FOR_MEASURED_DATA)); } + this.parentCodes = + parentCodesOrNull == null ? Collections.<String> emptyList() : parentCodesOrNull; this.producerCode = producerCodeOrNull; this.productionTimestamp = productionTimestampOrNull; }