diff options
author | mojahidi <mojahidul.islam@amdocs.com> | 2018-01-04 10:54:05 +0530 |
---|---|---|
committer | Vitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com> | 2018-01-04 10:12:13 +0000 |
commit | 004d3291f50da3db3e4f3c9cf5a8fd2c2af2a841 (patch) | |
tree | a4d96978fd157c87a4f881af2c00928173cc3ae4 /openecomp-be/api | |
parent | 172834d00381a5ad3b4c9d7a15699a31162c14bb (diff) |
Fixed sonar issues - ComponentDependenciesImpl
Fixed all sonar issues
Change-Id: Iaed4ea9bc7df52bd100d5d118b7212813ae22b76
Issue-ID: SDC-343
Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
Diffstat (limited to 'openecomp-be/api')
1 files changed, 18 insertions, 6 deletions
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<ComponentDependencyModelEntity> modelEntities = new - ArrayList<ComponentDependencyModelEntity>(); final Version version = new Version(versionId); @@ -68,7 +80,7 @@ public class ComponentDependenciesImpl implements ComponentDependencies { MapComponentDependencyEntityToDto mapper = new MapComponentDependencyEntityToDto(); GenericCollectionWrapper<ComponentDependencyResponseDto> results = new GenericCollectionWrapper - <ComponentDependencyResponseDto>(); + <>(); for (ComponentDependencyModelEntity entity : componentDependencies) { results.add(mapper.applyMapping(entity, ComponentDependencyResponseDto.class)); } |