aboutsummaryrefslogtreecommitdiffstats
path: root/aai-resources/src/main
diff options
context:
space:
mode:
authorVenkata Harish Kajur <vk250x@att.com>2018-01-17 14:55:42 +0000
committerGerrit Code Review <gerrit@onap.org>2018-01-17 14:55:42 +0000
commit9c04bb4a324af0857dacc65880c3540dc18d5b89 (patch)
tree85b9d209448571f4a0fde2a28991a42458235b1a /aai-resources/src/main
parent086088ae889bd30b39fa2ceede2875717e6da27e (diff)
parentb744b4733d1f075f67bafd63e68c8b0d66ea0ff5 (diff)
Merge "Sonar Minor:Remove duplicate literal"
Diffstat (limited to 'aai-resources/src/main')
-rw-r--r--aai-resources/src/main/java/org/onap/aai/rest/tools/ModelVersionTransformer.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/aai-resources/src/main/java/org/onap/aai/rest/tools/ModelVersionTransformer.java b/aai-resources/src/main/java/org/onap/aai/rest/tools/ModelVersionTransformer.java
index 876b65d..dd1dcda 100644
--- a/aai-resources/src/main/java/org/onap/aai/rest/tools/ModelVersionTransformer.java
+++ b/aai-resources/src/main/java/org/onap/aai/rest/tools/ModelVersionTransformer.java
@@ -80,6 +80,8 @@ public class ModelVersionTransformer extends RESTAPI {
private ModelType introspectorFactoryType = ModelType.MOXY;
private QueryStyle queryStyle = QueryStyle.TRAVERSAL;
protected static String MODEL_ELEMENTS = "model-elements";
+ private static final String RELATIONSHIP="relationship";
+
/**
* POST for model transformation.
@@ -261,15 +263,15 @@ public class ModelVersionTransformer extends RESTAPI {
Introspector newRelationshipList = newModelElements.getLoader().introspectorFromName("relationship-list");
newModelElement.setValue("relationship-list", newRelationshipList.getUnderlyingObject());
- List<Introspector> oldRelationshipListList = oldRelationshipList.getWrappedListValue("relationship");
- List<Object> newRelationshipListList = (List<Object>)newRelationshipList.getValue("relationship");
+ List<Introspector> oldRelationshipListList = oldRelationshipList.getWrappedListValue(RELATIONSHIP);
+ List<Object> newRelationshipListList = (List<Object>)newRelationshipList.getValue(RELATIONSHIP);
for (Introspector oldRelationship : oldRelationshipListList) {
- Introspector newRelationship = newModelElements.getLoader().introspectorFromName("relationship");
+ Introspector newRelationship = newModelElements.getLoader().introspectorFromName(RELATIONSHIP);
newRelationshipListList.add(newRelationship.getUnderlyingObject());
- List<Introspector> oldRelationshipData = oldRelationship.getWrappedListValue("relationship-data");
+ List<Introspector> oldRelationshipData = oldRelationship.getWrappedListValue(RELATIONSHIP);
List<Object> newRelationshipData = (List<Object>)newRelationship.getValue("relationship-data");
newRelationship.setValue("related-to", "model-ver");