summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-context
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2020-07-21 12:33:11 +0100
committerJvD_Ericsson <jeff.van.dam@est.tech>2020-07-22 21:26:23 +0100
commite666de6335e32f64f1999855d4ac8038e8873ec5 (patch)
treec02998396cc5bf6c6ac5e79ab569cd7e56e8e513 /plugins/plugins-context
parentd19067ce13765b7f98bcefb26b1bb469282c6624 (diff)
Fix replaceAll SONAR issues in apex-pdp
Change replaceAll() with repalce() in apex-pdp/plugins and apex-pdp/testsuites Issue-ID: POLICY-2722 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: Ib9d5256c050197b06f9df9c4cbb7562be081283c
Diffstat (limited to 'plugins/plugins-context')
-rw-r--r--plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaKeyTranslationUtilities.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaKeyTranslationUtilities.java b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaKeyTranslationUtilities.java
index bc695373b..965457206 100644
--- a/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaKeyTranslationUtilities.java
+++ b/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro/src/main/java/org/onap/policy/apex/plugins/context/schema/avro/AvroSchemaKeyTranslationUtilities.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +34,7 @@ import java.util.Map.Entry;
*/
public final class AvroSchemaKeyTranslationUtilities {
// Constants for key replacements
- private static final String DOT_STRING = "\\.";
+ private static final String DOT_STRING = ".";
private static final String DOT_STRING_REPLACEMENT = "_DoT_";
private static final String DASH_STRING = "-";
private static final String DASH_STRING_REPLACEMENT = "_DasH_";
@@ -133,9 +134,9 @@ public final class AvroSchemaKeyTranslationUtilities {
*/
private static String translateIllegalKey(final String key, final boolean revert) {
if (revert) {
- return key.replaceAll(DOT_STRING_REPLACEMENT, DOT_STRING).replaceAll(DASH_STRING_REPLACEMENT, DASH_STRING);
+ return key.replace(DOT_STRING_REPLACEMENT, DOT_STRING).replace(DASH_STRING_REPLACEMENT, DASH_STRING);
} else {
- return key.replaceAll(DOT_STRING, DOT_STRING_REPLACEMENT).replaceAll(DASH_STRING, DASH_STRING_REPLACEMENT);
+ return key.replace(DOT_STRING, DOT_STRING_REPLACEMENT).replace(DASH_STRING, DASH_STRING_REPLACEMENT);
}
}
}