Skip to content
Snippets Groups Projects
Commit 44f25210 authored by ribeaudc's avatar ribeaudc
Browse files

change: - Convert an assertion into a DataStructureException.

- 'performClosing' should be performed before the version is written out.

SVN: 7913
parent f7e65980
No related branches found
No related tags found
No related merge requests found
......@@ -132,8 +132,8 @@ abstract class AbstractDataStructure implements IDataStructure, IDataStructureHa
public final void close()
{
assertOpenOrCreated();
getVersion().saveTo(root);
performClosing();
getVersion().saveTo(root);
// TODO 2008-07-03, Bernd Rinn: make this optional
// assertValid();
storage.unmount();
......
......@@ -97,9 +97,11 @@ public final class DataStructureV1_1 extends DataStructureV1_0
public final void setSample(final Sample sample)
{
assert sample != null : "Unspecified sample.";
assert sample instanceof SampleWithOwner : "Must be an instance of SampleWithOwner.";
assertOpenOrCreated();
sample.saveTo(getMetaDataDirectory());
if (sample instanceof SampleWithOwner == false)
{
throw new DataStructureException("Must be an instance of SampleWithOwner.");
}
super.setSample(sample);
}
@Override
......
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