From 170a7e0ef195586ea59904637bb898459afd0c19 Mon Sep 17 00:00:00 2001
From: felmer <felmer>
Date: Wed, 30 Mar 2011 07:45:27 +0000
Subject: [PATCH] remove duplicated log messages

SVN: 20565
---
 .../cisd/yeastx/etl/DatasetMappingResolver.java      | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/DatasetMappingResolver.java b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/DatasetMappingResolver.java
index e8055121211..86b682c3b18 100644
--- a/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/DatasetMappingResolver.java
+++ b/rtd_yeastx/source/java/ch/systemsx/cisd/yeastx/etl/DatasetMappingResolver.java
@@ -117,12 +117,15 @@ class DatasetMappingResolver
         {
             return sampleCodeOrLabel;
         }
+        Boolean sampleExistsAndBelongsToExperiment = null;
         if (mapping.getExperimentName() == null)
         {
             // The main purpose of this checks is to ensure that sample with the given code exists.
             // If it is not a case, we will try to check if the specified sample label is unique (in
             // all experiments).
-            if (sampleExistsAndBelongsToExperiment(mapping, sampleCodeOrLabel, log))
+            sampleExistsAndBelongsToExperiment =
+                    sampleExistsAndBelongsToExperiment(mapping, sampleCodeOrLabel, log);
+            if (sampleExistsAndBelongsToExperiment)
             {
                 return sampleCodeOrLabel;
             }
@@ -139,7 +142,12 @@ class DatasetMappingResolver
         } else if (samples.size() == 0)
         {
             // try to assume that the sample code, not name, has been provided
-            if (sampleExistsAndBelongsToExperiment(mapping, sampleCodeOrLabel, log))
+            if (sampleExistsAndBelongsToExperiment == null)
+            {
+                sampleExistsAndBelongsToExperiment =
+                        sampleExistsAndBelongsToExperiment(mapping, sampleCodeOrLabel, log);
+            }
+            if (sampleExistsAndBelongsToExperiment)
             {
                 return sampleCodeOrLabel;
             } else
-- 
GitLab