From 153a35821f0d25ce23cca467b76c5a7c5092c744 Mon Sep 17 00:00:00 2001 From: Tal Gitelman Date: Mon, 3 Jul 2017 20:16:55 +0300 Subject: [sdc] - last merges before moving to LF Change-Id: I0df3ec795f0de84229ea4bb4806ec8f959243557 Signed-off-by: Tal Gitelman --- .../be/model/jsontitan/operations/BaseOperation.java | 2 +- .../model/operations/impl/GroupInstanceOperation.java | 2 +- .../tosca/converters/ToscaListValueConverter.java | 18 +++++++----------- 3 files changed, 9 insertions(+), 13 deletions(-) (limited to 'catalog-model/src/main/java/org') diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/BaseOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/BaseOperation.java index 407d711ed1..d29f989149 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/BaseOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/BaseOperation.java @@ -1350,7 +1350,7 @@ public abstract class BaseOperation { } protected String buildGroupInstanceName(String instanceName, String groupName) { - return ValidationUtils.normaliseComponentName(instanceName) + ".." + groupName; + return ValidationUtils.normalizeComponentInstanceName(instanceName) + ".." + groupName; } protected String generateCustomizationUUID() { 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 bd57689700..d282ecfae9 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 @@ -878,7 +878,7 @@ public class GroupInstanceOperation extends AbstractOperation implements IGroupI } private String buildGroupInstanceLogicalName(String instanceName, String groupName) { - return instanceName + ".." + groupName; + return ValidationUtils.normalizeComponentInstanceName(instanceName) + ".." + groupName; } /** diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/ToscaListValueConverter.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/ToscaListValueConverter.java index d8198dac6b..f3189ee968 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/ToscaListValueConverter.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/converters/ToscaListValueConverter.java @@ -109,19 +109,15 @@ public class ToscaListValueConverter extends ToscaValueBaseConverter implements asJsonArray.forEach(e -> { Object convertedValue = null; if (isScalarF) { - String jsonAsString = e.toString(); - log.debug("try to convert scalar value {}", jsonAsString); - if ( jsonAsString == null) { - convertedValue = null; + if (e.isJsonPrimitive()) { + String jsonAsString = e.getAsString(); + log.debug("try to convert scalar value {}", jsonAsString); + convertedValue = innerConverterFinal.convertToToscaValue(jsonAsString, innerType, + dataTypes); } else { - JsonElement singleElement = jsonParser.parse(jsonAsString); - if (singleElement.isJsonPrimitive()) { - convertedValue = innerConverterFinal.convertToToscaValue(jsonAsString, innerType, - dataTypes); - } else { - convertedValue = handleComplexJsonValue(singleElement); - } + convertedValue = handleComplexJsonValue(e); } + } else { JsonObject asJsonObject = e.getAsJsonObject(); Set> entrySet = asJsonObject.entrySet(); -- cgit 1.2.3-korg