Skip to content
Snippets Groups Projects
Commit c83f339a authored by felmer's avatar felmer
Browse files

logging improved

SVN: 20561
parent 5d3d455e
No related branches found
No related tags found
No related merge requests found
...@@ -122,7 +122,7 @@ class DatasetMappingResolver ...@@ -122,7 +122,7 @@ class DatasetMappingResolver
// The main purpose of this checks is to ensure that sample with the given code exists. // 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 // If it is not a case, we will try to check if the specified sample label is unique (in
// all experiments). // all experiments).
if (isConnectedToExperiment(sampleCodeOrLabel, mapping, log)) if (sampleExistsAndBelongsToExperiment(mapping, sampleCodeOrLabel, log))
{ {
return sampleCodeOrLabel; return sampleCodeOrLabel;
} }
...@@ -139,7 +139,7 @@ class DatasetMappingResolver ...@@ -139,7 +139,7 @@ class DatasetMappingResolver
} else if (samples.size() == 0) } else if (samples.size() == 0)
{ {
// try to assume that the sample code, not name, has been provided // try to assume that the sample code, not name, has been provided
if (isConnectedToExperiment(sampleCodeOrLabel, mapping, log)) if (sampleExistsAndBelongsToExperiment(mapping, sampleCodeOrLabel, log))
{ {
return sampleCodeOrLabel; return sampleCodeOrLabel;
} else } else
...@@ -255,7 +255,7 @@ class DatasetMappingResolver ...@@ -255,7 +255,7 @@ class DatasetMappingResolver
"when dataset is connected to a sample it cannot have parent datasets."); "when dataset is connected to a sample it cannot have parent datasets.");
return false; return false;
} }
return sampleExistsAndBelongsToExperiment(mapping, log, sampleCode); return sampleExistsAndBelongsToExperiment(mapping, sampleCode, log);
} }
} }
...@@ -337,9 +337,9 @@ class DatasetMappingResolver ...@@ -337,9 +337,9 @@ class DatasetMappingResolver
} }
private boolean sampleExistsAndBelongsToExperiment(DataSetMappingInformation mapping, private boolean sampleExistsAndBelongsToExperiment(DataSetMappingInformation mapping,
LogUtils log, String sampleCode) String sampleCode, LogUtils log)
{ {
if (isConnectedToExperiment(sampleCode, mapping, log) == false) if (isConnectedToExperiment(mapping, sampleCode, log) == false)
{ {
log.datasetMappingError(mapping, "sample with the code '%s' does not exist" log.datasetMappingError(mapping, "sample with the code '%s' does not exist"
+ " or is not connected to any experiment", sampleCode); + " or is not connected to any experiment", sampleCode);
...@@ -348,7 +348,7 @@ class DatasetMappingResolver ...@@ -348,7 +348,7 @@ class DatasetMappingResolver
return true; return true;
} }
private boolean isConnectedToExperiment(String sampleCode, DataSetMappingInformation mapping, private boolean isConnectedToExperiment(DataSetMappingInformation mapping, String sampleCode,
LogUtils log) LogUtils log)
{ {
SampleIdentifier sampleIdentifier = createSampleIdentifier(sampleCode, mapping); SampleIdentifier sampleIdentifier = createSampleIdentifier(sampleCode, mapping);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment