From 8edfa4dee9fed9be5b38133847c60136294eba80 Mon Sep 17 00:00:00 2001 From: vasraz Date: Wed, 18 Jan 2023 22:16:17 +0000 Subject: Fix 'Primitive types should not be shown under data types in catalog'-bug Signed-off-by: Vasyl Razinkov Change-Id: Ic20f7c5a0784c2107061f268c5c2e03ab34c13cc Issue-ID: SDC-4338 --- .../be/model/operations/impl/PropertyOperation.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'catalog-model') 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 d68a7706b6..9dc28cb2b4 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 @@ -1086,10 +1086,7 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe } private boolean checkFirstItem(String left, String right) { - if (left != null && left.equals(right)) { - return true; - } - return false; + return left != null && left.equals(right); } private String buildStringForMatch(List pathOfInstances, int level) { @@ -1565,10 +1562,10 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe if (dataTypeUidstoModels != null) { log.trace("Number of data types to load is {}", dataTypeUidstoModels.size()); - for (Map.Entry> entry : dataTypeUidstoModels.entrySet()) { - log.trace("Going to fetch data type with uid {}", entry.getKey()); - Either dataTypeByUid = this - .getAndAddDataTypeByUid(entry.getKey(), allDataTypesFound); + for (final Map.Entry> entry : dataTypeUidstoModels.entrySet()) { + final String key = entry.getKey(); + log.trace("Going to fetch data type with uid {}", key); + final Either dataTypeByUid = this.getAndAddDataTypeByUid(key, allDataTypesFound); if (dataTypeByUid.isRight()) { JanusGraphOperationStatus status = dataTypeByUid.right().value(); if (status == JanusGraphOperationStatus.NOT_FOUND) { @@ -1578,13 +1575,12 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe } for (final String model : entry.getValue()) { if (!dataTypes.containsKey(model)) { - dataTypes.put(model, new HashMap()); + dataTypes.put(model, new HashMap<>()); } DataTypeDefinition dataTypeDefinition = allDataTypesFound.get(entry.getKey()); dataTypes.get(model).put(dataTypeDefinition.getName(), dataTypeDefinition); } } - } if (log.isTraceEnabled()) { if (result.isRight()) { @@ -1766,9 +1762,6 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe return getDerivedResult == StorageOperationStatus.NOT_FOUND; } - /* - * @Override public PropertyOperation getPropertyOperation() { return this; } - */ public JanusGraphOperationStatus fillPropertiesList(String uniqueId, NodeTypeEnum nodeType, Consumer> propertySetter) { Either, JanusGraphOperationStatus> findPropertiesRes = findPropertiesifExist(uniqueId, nodeType); if (findPropertiesRes.isRight()) { -- cgit 1.2.3-korg