Fixing server context cache

This commit is contained in:
Luca Frosini 2023-05-15 17:41:34 +02:00
parent 20914f3f06
commit 804e2b2343
1 changed files with 8 additions and 7 deletions

View File

@ -185,27 +185,28 @@ public class ServerContextCache extends ContextCache {
if(c.getParent()!=null) {
IsParentOf ipo = c.getParent();
UUID parentUUID = ipo.getSource().getID();
UUID isParentOfParentUUID = ipo.getID();
UUID contextParentUUID = ipo.getSource().getID();
Context parentWithMeta = this.uuidToContext.get(parentUUID);
Context parentWithMeta = this.uuidToContext.get(contextParentUUID);
IsParentOf isParentOfWithMeta = new IsParentOfImpl(parentWithMeta, contextMeta);
isParentOfWithMeta.setID(parentUUID);
isParentOfWithMeta.setID(isParentOfParentUUID);
isParentOfWithMeta.setMetadata(ipo.getMetadata());
parentWithMeta.addChild(isParentOfWithMeta);
contextMeta.setParent(isParentOfWithMeta);
Context parentWithMetaPrivacy = this.uuidToContextMetaPrivacy.get(parentUUID);
Context parentWithMetaPrivacy = this.uuidToContextMetaPrivacy.get(contextParentUUID);
IsParentOf isParentOfMetaPrivacy = new IsParentOfImpl(parentWithMetaPrivacy, contextMetaPrivacy);
isParentOfMetaPrivacy.setID(parentUUID);
isParentOfMetaPrivacy.setID(isParentOfParentUUID);
Metadata metadataWithPrivacy = getMetadataForPrivacy(objectMapper, ipo.getMetadata());
isParentOfMetaPrivacy.setMetadata(metadataWithPrivacy);
parentWithMetaPrivacy.addChild(isParentOfMetaPrivacy);
contextMetaPrivacy.setParent(isParentOfMetaPrivacy);
Context parentNoMeta = this.uuidToContextNoMeta.get(parentUUID);
Context parentNoMeta = this.uuidToContextNoMeta.get(contextParentUUID);
IsParentOf isParentOfNoMeta = new IsParentOfImpl(parentNoMeta, contextNoMeta);
isParentOfNoMeta.setMetadata(null);
isParentOfNoMeta.setID(parentUUID);
isParentOfNoMeta.setID(isParentOfParentUUID);
parentNoMeta.addChild(isParentOfNoMeta);
contextNoMeta.setParent(isParentOfNoMeta);