From 52303c25db6305bff05751d1ff3c83d452afbf05 Mon Sep 17 00:00:00 2001 From: sourabh_sourabh Date: Mon, 20 Dec 2021 15:40:55 +0530 Subject: Fix Sonar Qube Violations - Recurring task Issue-ID: CPS-475 Signed-off-by: sourabh_sourabh Change-Id: I4279d5ca24b6cd78f419288eba10f557965c5e7b --- src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java | 2 +- .../java/org/onap/cps/ncmp/dmi/service/YangResourceExtractor.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java index 27a292de..4f126227 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/DmiServiceImpl.java @@ -186,7 +186,7 @@ public class DmiServiceImpl implements DmiService { } private String createModuleRequest(final ModuleReference moduleReference) { - final Map ietfNetconfModuleReferences = new LinkedHashMap(); + final Map ietfNetconfModuleReferences = new LinkedHashMap<>(); ietfNetconfModuleReferences.put("ietf-netconf-monitoring:identifier", moduleReference.getName()); ietfNetconfModuleReferences.put("ietf-netconf-monitoring:version", moduleReference.getRevision()); final ObjectWriter objectWriter = objectMapper.writer().withRootName("ietf-netconf-monitoring:input"); diff --git a/src/main/java/org/onap/cps/ncmp/dmi/service/YangResourceExtractor.java b/src/main/java/org/onap/cps/ncmp/dmi/service/YangResourceExtractor.java index d6ff3d2b..d41240b9 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/service/YangResourceExtractor.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/service/YangResourceExtractor.java @@ -22,6 +22,8 @@ package org.onap.cps.ncmp.dmi.service; import com.google.gson.Gson; import com.google.gson.JsonObject; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.ncmp.dmi.exception.ModuleResourceNotFoundException; import org.onap.cps.ncmp.dmi.model.YangResource; @@ -29,7 +31,9 @@ import org.onap.cps.ncmp.dmi.service.model.ModuleReference; import org.springframework.http.ResponseEntity; @Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) public class YangResourceExtractor { + static YangResource toYangResource(final ModuleReference moduleReference, final ResponseEntity responseEntity) { final YangResource yangResource = new YangResource(); -- cgit 1.2.3-korg