summaryrefslogtreecommitdiffstats
path: root/aai-resources/src
diff options
context:
space:
mode:
authoraishkashyap <as00476394@techmahindra.com>2017-12-21 13:06:35 +0530
committeraishkashyap <as00476394@techmahindra.com>2017-12-21 13:08:13 +0530
commit86fe6eea0640ae1991838e252640f102f10dc1e3 (patch)
tree028d9840fcaf52171f9bbba1f677d3cf283144fd /aai-resources/src
parent3c7c42eced8d5d15c026a1fa7264683fb4b3a562 (diff)
Sonar Minor:Constant instead of duplicate literal
Declare constant instead of duplicate literal Sonar Link: https://sonar.onap.org/component_issues/index?id=org.onap.aai.resources%3Aresources#severities=BLOCKER%2CMINOR|statuses=OPEN|assigned=false Location: src/main/java/org/onap/aai/rest/tools/ModelVersionTransformer.java Line No:183 Change-Id: I34b6e1874a56dd57686e5a34e17c1309452fd3f1 Issue-ID: AAI-575 Signed-off-by: aishkashyap <as00476394@techmahindra.com>
Diffstat (limited to 'aai-resources/src')
-rw-r--r--aai-resources/src/main/java/org/onap/aai/rest/tools/ModelVersionTransformer.java18
1 files changed, 9 insertions, 9 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 52fe859..490fdc6 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
@@ -79,7 +79,7 @@ public class ModelVersionTransformer extends RESTAPI {
protected static String authPolicyFunctionName = "REST";
private ModelType introspectorFactoryType = ModelType.MOXY;
private QueryStyle queryStyle = QueryStyle.TRAVERSAL;
-
+ protected static String MODEL_ELEMENTS = "model-elements";
/**
* POST for model transformation.
@@ -180,11 +180,11 @@ public class ModelVersionTransformer extends RESTAPI {
modelVerObj.setValue("model-version", oldModelVersion);
- if (obj.hasProperty("model-elements")) {
- Introspector oldModelElements = obj.getWrappedValue("model-elements");
+ if (obj.hasProperty(MODEL_ELEMENTS)) {
+ Introspector oldModelElements = obj.getWrappedValue(MODEL_ELEMENTS);
if (oldModelElements != null) {
- Introspector newModelElements = modelVerObj.newIntrospectorInstanceOfProperty("model-elements");
- modelVerObj.setValue("model-elements", newModelElements.getUnderlyingObject());
+ Introspector newModelElements = modelVerObj.newIntrospectorInstanceOfProperty(MODEL_ELEMENTS);
+ modelVerObj.setValue(MODEL_ELEMENTS, newModelElements.getUnderlyingObject());
repackModelElements(oldModelElements, newModelElements, modelVersionIdToModelInvariantIdMap);
}
}
@@ -315,11 +315,11 @@ public class ModelVersionTransformer extends RESTAPI {
}
}
- if (oldModelElement.hasProperty("model-elements")) {
- Introspector nextOldModelElements = oldModelElement.getWrappedValue("model-elements");
+ if (oldModelElement.hasProperty(MODEL_ELEMENTS)) {
+ Introspector nextOldModelElements = oldModelElement.getWrappedValue(MODEL_ELEMENTS);
if (nextOldModelElements != null) {
- Introspector nextNewModelElements = newModelElement.newIntrospectorInstanceOfProperty("model-elements");
- newModelElement.setValue("model-elements", nextNewModelElements.getUnderlyingObject());
+ Introspector nextNewModelElements = newModelElement.newIntrospectorInstanceOfProperty(MODEL_ELEMENTS);
+ newModelElement.setValue(MODEL_ELEMENTS, nextNewModelElements.getUnderlyingObject());
repackModelElements(nextOldModelElements, nextNewModelElements, modelVersionIdToModelInvariantIdMap);
}
}