From 531f22dd3eebf6581d923f4d794ffcd4f5d8dbe2 Mon Sep 17 00:00:00 2001 From: vasraz Date: Fri, 14 Jul 2023 15:32:42 +0100 Subject: Fix 'Import service with JUEL-function produces wrong UI representation' Signed-off-by: Vasyl Razinkov Change-Id: Icc37f2892fa5630df04d32e8496a57fc25ad7ad2 Issue-ID: SDC-4573 --- .../openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java | 3 ++- .../org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'catalog-model/src') diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java index 67d9755808..eb25b30e89 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/GroupInstanceOperation.java @@ -29,6 +29,7 @@ import java.util.UUID; import java.util.function.Supplier; import java.util.stream.Collectors; import org.apache.commons.collections.MapUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.tinkerpop.gremlin.structure.Vertex; import org.janusgraph.core.JanusGraph; @@ -405,7 +406,7 @@ public class GroupInstanceOperation extends AbstractOperation implements IGroupI final GroupInstanceData groupInstanceData = findResInstanceRes.left().value(); //TODO fix toscaFunctionValidator.validate(propDataDef, null); - propertyValueData.setValue(propDataDef.getToscaFunction().getValue()); + propertyValueData.setValue(StringEscapeUtils.unescapeJava(propDataDef.getToscaFunction().getValue())); } else { final String innerType = innerTypeEither.left().value(); Either isValid = propertyOperation diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java index dbe11a8efd..b2c2fec33f 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java @@ -59,6 +59,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.tinkerpop.gremlin.structure.Edge; @@ -1740,7 +1741,7 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe final Map dataTypes) { if (property.isToscaFunction()) { toscaFunctionValidator.validate(property, containerComponent); - property.setValue(property.getToscaFunction().getValue()); + property.setValue(StringEscapeUtils.unescapeJava(property.getToscaFunction().getValue())); return Either.left(property.getValue()); } Either checkInnerType = checkInnerType(property); -- cgit 1.2.3-korg