diff options
author | 2024-01-25 14:25:37 +0000 | |
---|---|---|
committer | 2024-02-07 14:59:50 +0000 | |
commit | beeb5e3846c8457987711491bcb58a6567870591 (patch) | |
tree | 227cdd91b00f3889a1109d457f968472cb7ee596 /utils-test/src/main/java | |
parent | 0241c0aa14447c99fccecc61e91b35051d6743be (diff) |
Remove Dmaap references from policy-common
- updated dependencies for jakarta.* compabilities
- other dependency updates for security fixes
Issue-ID: POLICY-4881
Change-Id: I979d944fcd21279f618d1bcbfe12e914ba30077f
Signed-off-by: rameshiyer27 <ramesh.murugan.iyer@est.tech>
Diffstat (limited to 'utils-test/src/main/java')
-rw-r--r-- | utils-test/src/main/java/org/onap/policy/common/utils/gson/GsonTestUtils.java | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/utils-test/src/main/java/org/onap/policy/common/utils/gson/GsonTestUtils.java b/utils-test/src/main/java/org/onap/policy/common/utils/gson/GsonTestUtils.java index 4aedf872..8276ea4c 100644 --- a/utils-test/src/main/java/org/onap/policy/common/utils/gson/GsonTestUtils.java +++ b/utils-test/src/main/java/org/onap/policy/common/utils/gson/GsonTestUtils.java @@ -3,6 +3,7 @@ * policy-management * ================================================================================ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +42,6 @@ import lombok.Getter; import org.apache.commons.jexl3.JexlBuilder; import org.apache.commons.jexl3.JexlContext; import org.apache.commons.jexl3.JexlEngine; -import org.apache.commons.jexl3.JexlException; import org.apache.commons.jexl3.MapContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -201,24 +201,19 @@ public class GsonTestUtils { while (mat.find(ilast)) { // append segment that appears between last match and this int inext = mat.start(); - bldr.append(text.substring(ilast, inext)); + bldr.append(text, ilast, inext); // next match begins after the current match ilast = mat.end(); // interpolate the script String script = mat.group(1); - try { - /* - * Note: must use "eng" instead of "engineInstance" to ensure that we use - * the same engine that's associated with the bindings. - */ - Object result = eng.createExpression(script).evaluate(context); - bldr.append(result == null ? "null" : result.toString()); - - } catch (JexlException e) { - throw new JsonParseException("cannot expand element: " + mat.group(), e); - } + /* + * Note: must use "eng" instead of "engineInstance" to ensure that we use + * the same engine that's associated with the bindings. + */ + Object result = eng.createExpression(script).evaluate(context); + bldr.append(result == null ? "null" : result.toString()); } // append final segment |