diff options
author | James Forsyth <jf2512@att.com> | 2018-02-01 17:26:05 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-02-01 17:26:05 +0000 |
commit | 0de265c8b69c955c296f368c2875e9845bb824e4 (patch) | |
tree | 020cdb0769356fe12b1c174fb423f292b48de0b3 /aai-traversal/src/main/java | |
parent | 4c843821d973c233cd96557f5a0feefadda8844d (diff) | |
parent | 808cf997318c94f5f3268049a8b80f395141eb3e (diff) |
Merge "Sonar Minor:Define a constant instead of literal."
Diffstat (limited to 'aai-traversal/src/main/java')
-rw-r--r-- | aai-traversal/src/main/java/org/onap/aai/rest/QueryConsumer.java | 6 |
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 3218396..1f4f359 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 @@ -74,6 +74,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; @@ -198,8 +200,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"); |