diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2017-10-02 15:29:17 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-10-02 15:29:17 +0000 |
commit | 68de84b9f3e3b751ce03f957565a65deb82cbfec (patch) | |
tree | 912e5e7e8234386e8876daa579a175a7c03c7b18 /mso-api-handlers/mso-api-handler-infra | |
parent | 50e2a74626a2f216e705c72ddb3a7e7e827756f1 (diff) | |
parent | de0d9b69834ebb6d93a5dca26de191834eda05ba (diff) |
Merge "Deleted redundant code"
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra')
-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 927cec66f1..1c2ee95dd9 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) { @@ -469,10 +467,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); |