From 004d3291f50da3db3e4f3c9cf5a8fd2c2af2a841 Mon Sep 17 00:00:00 2001 From: mojahidi Date: Thu, 4 Jan 2018 10:54:05 +0530 Subject: Fixed sonar issues - ComponentDependenciesImpl Fixed all sonar issues Change-Id: Iaed4ea9bc7df52bd100d5d118b7212813ae22b76 Issue-ID: SDC-343 Signed-off-by: mojahidi --- .../rest/services/ComponentDependenciesImpl.java | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java index 73c2bac976..eab5e3e892 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentDependenciesImpl.java @@ -1,3 +1,19 @@ +/* + * Copyright © 2016-2017 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.openecomp.sdcrests.vsp.rest.services; import org.openecomp.sdc.logging.context.MdcUtil; @@ -19,24 +35,20 @@ import org.springframework.stereotype.Service; import javax.inject.Named; import javax.ws.rs.core.Response; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; @Named @Service("componentDependencies") @Scope(value = "prototype") public class ComponentDependenciesImpl implements ComponentDependencies { - private ComponentDependencyModelManager componentDependencyModelManager = + private final ComponentDependencyModelManager componentDependencyModelManager = ComponentDependencyModelManagerFactory.getInstance().createInterface(); @Override public Response create(ComponentDependencyModel request, String vspId, String versionId, String user) { MdcUtil.initMdc(LoggerServiceName.CREATE_COMPONENT_DEPENDENCY_MODEL.toString()); - List modelEntities = new - ArrayList(); final Version version = new Version(versionId); @@ -68,7 +80,7 @@ public class ComponentDependenciesImpl implements ComponentDependencies { MapComponentDependencyEntityToDto mapper = new MapComponentDependencyEntityToDto(); GenericCollectionWrapper results = new GenericCollectionWrapper - (); + <>(); for (ComponentDependencyModelEntity entity : componentDependencies) { results.add(mapper.applyMapping(entity, ComponentDependencyResponseDto.class)); } -- cgit 1.2.3-korg