Fixed test conrner case
This commit is contained in:
parent
a553b9cd8d
commit
dbbdd206d5
|
@ -89,10 +89,18 @@ public abstract class ElementManagement<El extends OElement> {
|
||||||
protected JsonNode jsonNode;
|
protected JsonNode jsonNode;
|
||||||
protected OClass oClass;
|
protected OClass oClass;
|
||||||
protected String elementType;
|
protected String elementType;
|
||||||
|
|
||||||
|
protected JsonNode self;
|
||||||
|
protected JsonNode complete;
|
||||||
|
|
||||||
protected El element;
|
protected El element;
|
||||||
protected boolean reload;
|
protected boolean reload;
|
||||||
|
|
||||||
|
public void cleanCachedSerialization() {
|
||||||
|
this.self = null;
|
||||||
|
this.complete = null;
|
||||||
|
}
|
||||||
|
|
||||||
public UUID getUUID() {
|
public UUID getUUID() {
|
||||||
return uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
|
@ -154,6 +162,7 @@ public abstract class ElementManagement<El extends OElement> {
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
try {
|
try {
|
||||||
this.jsonNode = mapper.readTree(json);
|
this.jsonNode = mapper.readTree(json);
|
||||||
|
cleanCachedSerialization();
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
throw new ResourceRegistryException(e);
|
throw new ResourceRegistryException(e);
|
||||||
}
|
}
|
||||||
|
@ -293,7 +302,10 @@ public abstract class ElementManagement<El extends OElement> {
|
||||||
|
|
||||||
public JsonNode serializeSelfAsJsonNode() throws ResourceRegistryException {
|
public JsonNode serializeSelfAsJsonNode() throws ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
return createSelfJsonNode();
|
if(self==null) {
|
||||||
|
self = createSelfJsonNode();
|
||||||
|
}
|
||||||
|
return self.deepCopy();
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
throw new ResourceRegistryException(e);
|
throw new ResourceRegistryException(e);
|
||||||
}
|
}
|
||||||
|
@ -303,7 +315,10 @@ public abstract class ElementManagement<El extends OElement> {
|
||||||
|
|
||||||
public JsonNode serializeAsJsonNode() throws ResourceRegistryException {
|
public JsonNode serializeAsJsonNode() throws ResourceRegistryException {
|
||||||
try {
|
try {
|
||||||
return createCompleteJsonNode();
|
if(complete==null) {
|
||||||
|
complete = createCompleteJsonNode();
|
||||||
|
}
|
||||||
|
return complete;
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
throw new ResourceRegistryException(e);
|
throw new ResourceRegistryException(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue