From 3d45bf25cb0d2424df13d550b3874e2ea60b7b5b Mon Sep 17 00:00:00 2001
From: ribeaudc <ribeaudc>
Date: Mon, 7 Apr 2008 20:12:20 +0000
Subject: [PATCH] fix: - Integration tests (maybe...).

SVN: 5320
---
 .../java/ch/systemsx/cisd/bds/DataSet.java    | 20 ++++---------------
 1 file changed, 4 insertions(+), 16 deletions(-)

diff --git a/bds/source/java/ch/systemsx/cisd/bds/DataSet.java b/bds/source/java/ch/systemsx/cisd/bds/DataSet.java
index f0e3055812e..5b2028d56fe 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;
     }
-- 
GitLab