summaryrefslogtreecommitdiffstats
path: root/aai-traversal
diff options
context:
space:
mode:
authoraishkashyap <as00476394@techmahindra.com>2018-01-15 13:55:18 +0530
committeraishkashyap <as00476394@techmahindra.com>2018-01-15 13:55:31 +0530
commit808cf997318c94f5f3268049a8b80f395141eb3e (patch)
treede7417047ca501ac96ab012c54fee045b17fb678 /aai-traversal
parent78c96d11932a849a1702ab134391918a723f01ef (diff)
Sonar Minor:Define a constant instead of literal.
Define a constant instead of duplicating this literal depth. Sonar Link: https://sonar.onap.org/component_issues/index?id=org.onap.aai.traversal%3Atraversal#resolved=false|assignees=aishkashyap Location: src/main/java/org/onap/aai/rest/QueryConsumer.java Line No:186 Issue-ID: AAI-656 Change-Id: I92e4753aa501d939bd1b85732fcadeaebfbdef16 Signed-off-by: aishkashyap <as00476394@techmahindra.com>
Diffstat (limited to 'aai-traversal')
-rw-r--r--aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java b/aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java
index b5f2658..9e7edeb 100644
--- a/aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java
+++ b/aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java
@@ -70,6 +70,8 @@ import com.google.gson.JsonParser;
@Path("{version: v9|v1[012]}/query")
public class QueryConsumer extends RESTAPI {
+
+ private static final String DEPTH = "depth";
/** The introspector factory type. */
private ModelType introspectorFactoryType = ModelType.MOXY;
@@ -183,8 +185,8 @@ public class QueryConsumer extends RESTAPI {
public void checkQueryParams(MultivaluedMap<String, String> params) throws AAIException {
- if (params.containsKey("depth") && params.getFirst("depth").matches("\\d+")) {
- String depth = params.getFirst("depth");
+ if (params.containsKey(DEPTH) && params.getFirst(DEPTH).matches("\\d+")) {
+ String depth = params.getFirst(DEPTH);
Integer i = Integer.parseInt(depth);
if (i > 1) {
throw new AAIException("AAI_3303");