aboutsummaryrefslogtreecommitdiffstats
path: root/aai-resources/src/main/java/org/onap
diff options
context:
space:
mode:
authoraishkashyap <as00476394@techmahindra.com>2017-12-21 16:10:00 +0530
committerVenkata Harish K Kajur <vk250x@att.com>2018-01-08 09:43:45 -0500
commitb744b4733d1f075f67bafd63e68c8b0d66ea0ff5 (patch)
treeb466137dbb9255a1acd514425a8c5403e6d294f6 /aai-resources/src/main/java/org/onap
parent6c70463a3347beaa54e034266019ea3c6733c8f0 (diff)
Sonar Minor:Remove duplicate literal
Remove duplicate literal Sonar Link: https://sonar.onap.org/component_issues/index?id=org.onap.aai.resources%3Aresources#statuses=OPEN|assignees=aishkashyap Location: src/main/java/org/onap/aai/rest/tools/ModelVersionTransformer.java Line No:264 Issue-ID: AAI-578 Change-Id: Idb14c0568c2740dd9257b965b4dce8a7e4b34548 Signed-off-by: aishkashyap <as00476394@techmahindra.com> Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'aai-resources/src/main/java/org/onap')
-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");