diff options
author | shashikanth <shashikanth.vh@huawei.com> | 2017-09-26 18:08:36 +0530 |
---|---|---|
committer | shashikanth <shashikanth.vh@huawei.com> | 2017-09-26 18:08:36 +0530 |
commit | de0d9b69834ebb6d93a5dca26de191834eda05ba (patch) | |
tree | 8b493e682796922f907d88378d5070b0feda470f /mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp | |
parent | 00f6a9c613096e3d4623b8e8486992be727d92da (diff) |
Deleted redundant code
Fix major sonar issues in so module
https://sonar.onap.org/component_issues?id=org.openecomp.so%3Aso#resolved=false|severities=BLOCKER%2CMAJOR|rules=squid%3AS1132%2Csquid%3AS1143
Move the "service" string literal on the left side of this string comparison.
Deleted redundant variables
Issue-Id: APPC-186
Change-Id: I25410825aadfaf1ff444c6fa39d2783344db70d0
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp')
-rw-r--r-- | mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java index 0c0c3cb339..eb20f87b77 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/E2EServiceInstances.java @@ -87,9 +87,7 @@ public class E2EServiceInstances { @ApiOperation(value="Create a E2E Service Instance on a version provided",response=Response.class) public Response createE2EServiceInstance(String request, @PathParam("version") String version) { - Response response = E2EserviceInstances(request, Action.createInstance, null, version); - - return response; + return E2EserviceInstances(request, Action.createInstance, null, version); } /** @@ -103,14 +101,13 @@ public class E2EServiceInstances { @ApiOperation(value="Delete E2E Service Instance on a specified version and serviceId",response=Response.class) public Response deleteE2EServiceInstance(String request, @PathParam("version") String version, @PathParam("serviceId") String serviceId) { - instanceIdMap.put("serviceId", serviceId); - Response response = E2EserviceInstances(request, Action.deleteInstance, null, version); + instanceIdMap.put("serviceId", serviceId); - return response; + return E2EserviceInstances(request, Action.deleteInstance, null, version); } private Response E2EserviceInstances(String requestJSON, Action action, - HashMap<String, String> instanceIdMap, String version) { + HashMap<String, String> instanceIdMap, String version) { String requestId = UUIDChecker.generateUUID(msoLogger); long startTime = System.currentTimeMillis(); @@ -148,7 +145,8 @@ public class E2EServiceInstances { String requestScope = sir.getService().getParameters().getNodeType(); try { - if(!(instanceName==null && requestScope.equals("service") && (action == Action.createInstance || action == Action.activateInstance))){ + if(!(instanceName==null && "service".equals(requestScope) && (action == Action.createInstance || action + == Action.activateInstance))){ dup = (RequestsDatabase.getInstance()).checkInstanceNameDuplicate (instanceIdMap, instanceName, requestScope); } } catch (Exception e) { @@ -493,10 +491,10 @@ public class E2EServiceInstances { requestParameters.setSubscriptionServiceType("MOG"); //Userparams - List<E2EUserParam> userParams = new ArrayList<>(); + List<E2EUserParam> userParams; userParams = e2eSir.getService().getParameters().getRequestParameters().getUserParams(); - List<Map<String, String>> userParamList = new ArrayList<Map<String,String>>(); - Map<String,String> userParamMap= new HashMap<String, String>(); + List<Map<String, String>> userParamList = new ArrayList<>(); + Map<String,String> userParamMap= new HashMap<>(); for(E2EUserParam userp: userParams){ userParamMap.put(userp.getName(), userp.getValue()); userParamList.add(userParamMap); |