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