summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/main/java
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2023-01-18 22:16:17 +0000
committerVasyl Razinkov <vasyl.razinkov@est.tech>2023-01-19 12:30:39 +0000
commit8edfa4dee9fed9be5b38133847c60136294eba80 (patch)
treecd5d9593ed7c8778912a1941e52dde2c8a0748b7 /catalog-model/src/main/java
parentc183513f5c5813f6a911a5ceb7ac81405007aaff (diff)
Fix 'Primitive types should not be shown under data types in catalog'-bug
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: Ic20f7c5a0784c2107061f268c5c2e03ab34c13cc Issue-ID: SDC-4338
Diffstat (limited to 'catalog-model/src/main/java')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java19
1 files changed, 6 insertions, 13 deletions
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<String> 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<String, List<String>> entry : dataTypeUidstoModels.entrySet()) {
- log.trace("Going to fetch data type with uid {}", entry.getKey());
- Either<DataTypeDefinition, JanusGraphOperationStatus> dataTypeByUid = this
- .getAndAddDataTypeByUid(entry.getKey(), allDataTypesFound);
+ for (final Map.Entry<String, List<String>> entry : dataTypeUidstoModels.entrySet()) {
+ final String key = entry.getKey();
+ log.trace("Going to fetch data type with uid {}", key);
+ final Either<DataTypeDefinition, JanusGraphOperationStatus> 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<String, DataTypeDefinition>());
+ 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<List<PropertyDefinition>> propertySetter) {
Either<Map<String, PropertyDefinition>, JanusGraphOperationStatus> findPropertiesRes = findPropertiesifExist(uniqueId, nodeType);
if (findPropertiesRes.isRight()) {