Skip to content
Snippets Groups Projects
Commit 6916907c authored by cramakri's avatar cramakri
Browse files

LMS-2104 Fixed bugs discovered by FJE.

SVN: 21456
parent 267c088e
No related branches found
No related tags found
No related merge requests found
......@@ -222,7 +222,9 @@ public class DataSet<T extends DataSetInformation> implements IDataSet
public void setContainedDataSetCodes(List<String> containedDataSetCodes)
{
ArrayList<String> newContainedDataSetCodes = new ArrayList<String>(containedDataSetCodes);
ArrayList<String> newContainedDataSetCodes =
(null == containedDataSetCodes) ? new ArrayList<String>() : new ArrayList<String>(
containedDataSetCodes);
registrationDetails.getDataSetInformation().setContainedDataSetCodes(
newContainedDataSetCodes);
......
......@@ -1219,23 +1219,45 @@ public class ETLService extends AbstractCommonServer<IETLService> implements IET
ArrayList<DataPE> dataSetsCreated = new ArrayList<DataPE>();
ArrayList<? extends NewExternalData> dataSetRegistrations =
operationDetails.getDataSetRegistrations();
ArrayList<NewContainerDataSet> containerRegistrations =
new ArrayList<NewContainerDataSet>();
// In the first pass, skip container data sets
for (NewExternalData dataSet : dataSetRegistrations)
{
SampleIdentifier sampleIdentifier = dataSet.getSampleIdentifierOrNull();
IDataBO dataBO;
if (sampleIdentifier != null)
if (dataSet instanceof NewContainerDataSet)
{
dataBO = registerDataSetInternal(session, sampleIdentifier, dataSet);
containerRegistrations.add((NewContainerDataSet) dataSet);
} else
{
ExperimentIdentifier experimentIdentifier = dataSet.getExperimentIdentifierOrNull();
dataBO = registerDataSetInternal(session, experimentIdentifier, dataSet);
registerDatasetInternal(session, dataSetsCreated, dataSet);
}
dataSetsCreated.add(dataBO.getData());
}
// Now do the containers
for (NewContainerDataSet dataSet : containerRegistrations)
{
registerDatasetInternal(session, dataSetsCreated, dataSet);
}
return DataSetTranslator.translate(dataSetsCreated, "", session.getBaseIndexURL());
}
private void registerDatasetInternal(final Session session, ArrayList<DataPE> dataSetsCreated,
NewExternalData dataSet)
{
SampleIdentifier sampleIdentifier = dataSet.getSampleIdentifierOrNull();
IDataBO dataBO;
if (sampleIdentifier != null)
{
dataBO = registerDataSetInternal(session, sampleIdentifier, dataSet);
} else
{
ExperimentIdentifier experimentIdentifier = dataSet.getExperimentIdentifierOrNull();
dataBO = registerDataSetInternal(session, experimentIdentifier, dataSet);
}
dataSetsCreated.add(dataBO.getData());
}
private ArrayList<Experiment> createExperiments(String sessionToken,
AtomicEntityOperationDetails operationDetails)
{
......
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