From d981ef67e956f1e5a28ca77f2841f49e468c5b1b Mon Sep 17 00:00:00 2001 From: ojasdubey Date: Wed, 23 May 2018 18:04:28 +0530 Subject: Refactor Onboarding Translator code 1. Fixed sonar violations 2. Fixed static analysis issues 3. Refactored methods for code smells 4. Moved log messages to a common place Change-Id: I33725bc51040a2c7683b06b4294dea6f96c425e3 Issue-ID: SDC-1331 Signed-off-by: ojasdubey --- .../src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java | 3 ++- .../src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'openecomp-be/lib/openecomp-tosca-lib/src/main') diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java index 69231d5c51..a8629aa287 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java @@ -1190,7 +1190,8 @@ public class DataModelUtil { SubstitutionMapping substitutionMapping = new SubstitutionMapping(); substitutionMapping.setNode_type(nodeTypeKey); substitutionMapping.setCapabilities( - manageCapabilityMapping(substitutionNodeType.getCapabilities(), mapping.get("capability"))); + manageCapabilityMapping(substitutionNodeType.getCapabilities(), mapping.get(ToscaConstants + .CAPABILITY))); substitutionMapping.setRequirements( manageRequirementMapping(substitutionNodeType.getRequirements(), mapping.get("requirement"))); diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java index 47e2c9a2e1..4ce2535401 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/ToscaConstants.java @@ -65,6 +65,8 @@ public class ToscaConstants { static final String ST_METADATA_FILE_NAME = "filename"; public static final String MANDATORY_PROPERTY_NAME = "mandatory"; public static final String HEAT_NODE_TYPE_SUFFIX = "heat."; + public static final String CAPABILITY = "capability"; + public static final String REQUIREMENT = "requirement"; private ToscaConstants() { //Hiding the implicit public constructor -- cgit 1.2.3-korg