diff --git a/drools-reliability/drools-reliability-core/src/main/java/org/drools/reliability/core/SimpleSerializationReliableRefObjectStore.java b/drools-reliability/drools-reliability-core/src/main/java/org/drools/reliability/core/SimpleSerializationReliableRefObjectStore.java index 2fc9f3b36b1..6ccf4d6e38b 100644 --- a/drools-reliability/drools-reliability-core/src/main/java/org/drools/reliability/core/SimpleSerializationReliableRefObjectStore.java +++ b/drools-reliability/drools-reliability-core/src/main/java/org/drools/reliability/core/SimpleSerializationReliableRefObjectStore.java @@ -32,6 +32,9 @@ public class SimpleSerializationReliableRefObjectStore extends SimpleSerializati public SimpleSerializationReliableRefObjectStore(Storage 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; } @@ -100,7 +103,7 @@ private List getReferencedObjects(Object object){ Field[] fields = object.getClass().getDeclaredFields(); List fieldsWithTypeInTheStore = Arrays.stream(fields) - .filter(field -> uniqueObjectTypesInStore.keySet().contains(field.getType())) + .filter(field -> uniqueObjectTypesInStore.containsKey(field.getType())) .collect(Collectors.toList()); return fieldsWithTypeInTheStore; }