summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-12-17 17:03:30 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-12-17 17:03:41 +0530
commite2646080e47df8d68e0327d964194a2b6ce04d33 (patch)
treeec6522d730eca0f34d8d31079b5d889529931121
parent6dd2c1b07cc306750dd9ee93cf8bb2f615f076aa (diff)
fixed sonar issues in SvcLogicExpressionResolver
fixed sonar issues Issue-ID: CCSDK-525 Change-Id: I2859ef1de0fe36ee5bac46fe5adec6142333ba50 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicExpressionResolver.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicExpressionResolver.java b/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicExpressionResolver.java
index 779be9e9e..0e502035b 100644
--- a/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicExpressionResolver.java
+++ b/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SvcLogicExpressionResolver.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* 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
@@ -41,6 +43,7 @@ public class SvcLogicExpressionResolver {
private static final Logger LOG = LoggerFactory
.getLogger(SvcLogicExpressionResolver.class);
+ private static final String INVALID_EXPRESSION_MSG= "Invalid expression (";
public static String evaluate(SvcLogicExpression expr, SvcLogicNode node,
SvcLogicContext ctx) throws SvcLogicException {
@@ -150,7 +153,7 @@ public class SvcLogicExpressionResolver {
List<OperatorType> operators = binExpr.getOperators();
if (operands.size() != (operators.size()+1))
{
- throw new SvcLogicException("Invalid expression ("+binExpr+")");
+ throw new SvcLogicException(INVALID_EXPRESSION_MSG+binExpr+")");
}
String retval = evaluate(operands.get(0), node, ctx);
String retsval = retval;
@@ -303,7 +306,7 @@ public class SvcLogicExpressionResolver {
if (operands.size() != (operators.size()+1))
{
- throw new SvcLogicException("Invalid expression ("+expr+")");
+ throw new SvcLogicException(INVALID_EXPRESSION_MSG+expr+")");
}
try
@@ -326,7 +329,7 @@ public class SvcLogicExpressionResolver {
}
catch (Exception e)
{
- throw new SvcLogicException("Invalid expression ("+expr+")");
+ throw new SvcLogicException(INVALID_EXPRESSION_MSG+expr+")");
}