aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToineSiebelink <toine.siebelink@est.tech>2021-04-07 16:04:37 +0100
committerToineSiebelink <toine.siebelink@est.tech>2021-04-07 16:04:47 +0100
commit689521eb9d1b07e62bc7fe6278ddb6c905e8aa38 (patch)
treedd0fa55d6a088a7a544610fb0ee950e6d0bebc0d
parent674935d2ba1bad2b00f24815a9168b08cbf04933 (diff)
Fix SonarQube violations
- Used @SupressWarning where issue was casued by 3PP we have not control over - Remove TODO's which are now addt to backlog as new JIRA's; CPS-324 and CPS-325 Issue-ID: CPS-89 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ieb64fd6d3f09144f6dea965c0aee3aefa6ec253c
-rwxr-xr-xcps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java2
-rw-r--r--cps-service/src/main/java/org/onap/cps/utils/DataMapUtils.java5
-rw-r--r--cps-service/src/main/java/org/onap/cps/utils/YangUtils.java4
3 files changed, 5 insertions, 6 deletions
diff --git a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
index 8366f06b38..f466ebcef0 100755
--- a/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
+++ b/cps-rest/src/main/java/org/onap/cps/rest/controller/DataRestController.java
@@ -2,6 +2,7 @@
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Bell Canada. All rights reserved.
* Modifications Copyright (C) 2021 Pantheon.tech
+ * Modifications (C) 2021 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,7 +57,6 @@ public class DataRestController implements CpsDataApi {
public ResponseEntity<Object> getNodeByDataspaceAndAnchor(final String dataspaceName, final String anchorName,
final String xpath, final Boolean includeDescendants) {
if ("/".equals(xpath)) {
- // TODO: extracting data by anchor only (root data node and below)
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
final FetchDescendantsOption fetchDescendantsOption = Boolean.TRUE.equals(includeDescendants)
diff --git a/cps-service/src/main/java/org/onap/cps/utils/DataMapUtils.java b/cps-service/src/main/java/org/onap/cps/utils/DataMapUtils.java
index 3ec4764bd6..3ee6afb719 100644
--- a/cps-service/src/main/java/org/onap/cps/utils/DataMapUtils.java
+++ b/cps-service/src/main/java/org/onap/cps/utils/DataMapUtils.java
@@ -1,6 +1,7 @@
/*
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Pantheon.tech
+ * Modifications (C) 2021 Nordix Foundation
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,10 +33,6 @@ import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.onap.cps.spi.model.DataNode;
-/*
- TODO: this utility class belongs to REST, however it expected to be used by both CPS Core and xNF Proxy;
- placed in cps-service until shared module is done for REST services, then to be moved there
- */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class DataMapUtils {
diff --git a/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java b/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java
index 6df973dc42..edef5cbca5 100644
--- a/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java
+++ b/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2020 Nordix Foundation
+ * Copyright (C) 2020-2021 Nordix Foundation
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* Modifications Copyright (C) 2021 Pantheon.tech
* ================================================================================
@@ -61,6 +61,7 @@ public class YangUtils {
* @param schemaContext schema context describing associated data model
* @return the NormalizedNode object
*/
+ @SuppressWarnings("squid:S1452") // Generic type <? ,?> is returned by external librray, opendaylight.yangtools
public static NormalizedNode<?, ?> parseJsonData(final String jsonData, final SchemaContext schemaContext) {
return parseJsonData(jsonData, schemaContext, Optional.empty());
}
@@ -73,6 +74,7 @@ public class YangUtils {
* @param parentNodeXpath the xpath referencing the parent node current data fragment belong to
* @return the NormalizedNode object
*/
+ @SuppressWarnings("squid:S1452") // Generic type <? ,?> is returned by external librray, opendaylight.yangtools
public static NormalizedNode<?, ?> parseJsonData(final String jsonData, final SchemaContext schemaContext,
final String parentNodeXpath) {
final DataSchemaNode parentSchemaNode = getDataSchemaNodeByXpath(parentNodeXpath, schemaContext);