Сделал очищение, а не создание новой коллекции
This commit is contained in:
parent
239f4bdec8
commit
f2b0279b17
@ -186,16 +186,22 @@ public class StorageCollection<T extends DrawningBoat> {
|
|||||||
String s = fs.readLine();
|
String s = fs.readLine();
|
||||||
if (s == null || !s.startsWith(_collectionSingleKey))
|
if (s == null || !s.startsWith(_collectionSingleKey))
|
||||||
return false;
|
return false;
|
||||||
if (keys.contains(s)) {
|
ICollectionGenericObjects<DrawningBoat> collection;
|
||||||
_storages.get(s).ClearCollection();
|
|
||||||
}
|
|
||||||
s = fs.readLine();
|
s = fs.readLine();
|
||||||
String[] record = s.split(_separatorForKeyValue);
|
String[] record = s.split(_separatorForKeyValue);
|
||||||
if (record.length != 4) {
|
if (record.length != 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (keys.contains(s)) {
|
||||||
|
_storages.get(s).ClearCollection();
|
||||||
|
collection = (ICollectionGenericObjects<DrawningBoat>) _storages.get(s);
|
||||||
|
}
|
||||||
|
else {
|
||||||
CollectionType collectionType = Enum.valueOf(CollectionType.class, record[1]);
|
CollectionType collectionType = Enum.valueOf(CollectionType.class, record[1]);
|
||||||
ICollectionGenericObjects<DrawningBoat> collection = CreateCollection(collectionType);
|
collection = CreateCollection(collectionType);
|
||||||
|
}
|
||||||
if (collection == null)
|
if (collection == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user