Skip to content

Commit

Permalink
init uniqueObjectTypesInStore
Browse files Browse the repository at this point in the history
  • Loading branch information
nprentza committed Aug 4, 2023
1 parent 42a8db3 commit 102c2ef
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public class SimpleSerializationReliableRefObjectStore extends SimpleSerializati
public SimpleSerializationReliableRefObjectStore(Storage<Long, StoredObject> storage) {
super(storage);
uniqueObjectTypesInStore = new HashMap<>();
if (storage.size()>0){
storage.values().forEach(sObject -> {this.putIntoObjectTypesList( sObject.getObject() );});
}
this.storage = storage.size()>0 ? updateObjectReferences(storage) : storage;
}

Expand Down Expand Up @@ -100,7 +103,7 @@ private List<Field> getReferencedObjects(Object object){
Field[] fields = object.getClass().getDeclaredFields();

List<Field> fieldsWithTypeInTheStore = Arrays.stream(fields)
.filter(field -> uniqueObjectTypesInStore.keySet().contains(field.getType()))
.filter(field -> uniqueObjectTypesInStore.containsKey(field.getType()))
.collect(Collectors.toList());
return fieldsWithTypeInTheStore;
}
Expand Down

0 comments on commit 102c2ef

Please sign in to comment.