summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main/java/org')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceInterfacesMerge.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceInterfacesMerge.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceInterfacesMerge.java
index 6f5dd03e6d..ecbeb21fea 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceInterfacesMerge.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/instance/ComponentInstanceInterfacesMerge.java
@@ -93,10 +93,10 @@ public class ComponentInstanceInterfacesMerge implements ComponentInstanceMergeI
mergeOperationInputDefinitions(oldOperationDef.getInputs(), newOperationDefKeyValue.getInputs(),
originalOperationDef.getInputs());
}
- if (!originalOperationDef.getImplementation().equals(oldOperationDef.getImplementation())) {
+ if (originalValueOverwritten(originalOperationDef.getImplementation(), oldOperationDef.getImplementation()) ) {
newOperationDefKeyValue.setImplementation(oldOperationDef.getImplementation());
}
- if (!originalOperationDef.getDescription().equals(oldOperationDef.getDescription())) {
+ if (originalValueOverwritten(originalOperationDef.getDescription(), oldOperationDef.getDescription())) {
newOperationDefKeyValue.setDescription(oldOperationDef.getDescription());
}
newInterfaceDefOperationMap.put(newOperationDefKey, newOperationDefKeyValue);
@@ -106,6 +106,13 @@ public class ComponentInstanceInterfacesMerge implements ComponentInstanceMergeI
StorageOperationStatus updateStatus = toscaOperationFacade.updateComponentInstanceInterfaces(currentComponent, instanceId);
return componentsUtils.convertFromStorageResponse(updateStatus);
}
+
+ private <T> boolean originalValueOverwritten(final T originalValue, final T oldValue) {
+ if (originalValue == null) {
+ return oldValue != null;
+ }
+ return !originalValue.equals(oldValue);
+ }
private void mergeOperationInputDefinitions(ListDataDefinition<OperationInputDefinition> oldInputs,
ListDataDefinition<OperationInputDefinition> newInputs,