diff --git a/ProjectCatamaran/src/CollectionGenericObjects/StorageCollection.java b/ProjectCatamaran/src/CollectionGenericObjects/StorageCollection.java index ff22f0e..f973ed3 100644 --- a/ProjectCatamaran/src/CollectionGenericObjects/StorageCollection.java +++ b/ProjectCatamaran/src/CollectionGenericObjects/StorageCollection.java @@ -186,16 +186,22 @@ public class StorageCollection { String s = fs.readLine(); if (s == null || !s.startsWith(_collectionSingleKey)) return false; - if (keys.contains(s)) { - _storages.get(s).ClearCollection(); - } + ICollectionGenericObjects collection; + s = fs.readLine(); String[] record = s.split(_separatorForKeyValue); if (record.length != 4) { return false; } - CollectionType collectionType = Enum.valueOf(CollectionType.class, record[1]); - ICollectionGenericObjects collection = CreateCollection(collectionType); + + if (keys.contains(s)) { + _storages.get(s).ClearCollection(); + collection = (ICollectionGenericObjects) _storages.get(s); + } + else { + CollectionType collectionType = Enum.valueOf(CollectionType.class, record[1]); + collection = CreateCollection(collectionType); + } if (collection == null) { return false;