diff options
author | James Forsyth <jf2512@att.com> | 2018-01-08 13:57:01 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-01-08 13:57:01 +0000 |
commit | 52edb704221aae0186fbccd5cdae7f59a4816463 (patch) | |
tree | d504aab5efc14c6c0a7fac243a218307976de50c /aai-resources/src/main/java/org/onap | |
parent | 2219c491e57b8c919615dd3657ea50547b7eddc3 (diff) | |
parent | 86fe6eea0640ae1991838e252640f102f10dc1e3 (diff) |
Merge "Sonar Minor:Constant instead of duplicate literal"
Diffstat (limited to 'aai-resources/src/main/java/org/onap')
-rw-r--r-- | aai-resources/src/main/java/org/onap/aai/rest/tools/ModelVersionTransformer.java | 18 |
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 8572369..a70e288 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); } } |