summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro
diff options
context:
space:
mode:
authorRam Krishna Verma <ram_krishna.verma@bell.ca>2020-07-23 14:42:39 +0000
committerGerrit Code Review <gerrit@onap.org>2020-07-23 14:42:39 +0000
commit3b918bdd862e44a1532704413bfc05adb42997a3 (patch)
treeb1ccd8dd60964b86c6f00ec9c761fa4d063a06f4 /plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro
parent7d640cc3ababa6d076878dcb75411fc7ffe4b4d0 (diff)
parente666de6335e32f64f1999855d4ac8038e8873ec5 (diff)
Merge "Fix replaceAll SONAR issues in apex-pdp"
Diffstat (limited to 'plugins/plugins-context/plugins-context-schema/plugins-context-schema-avro')
-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);
}
}
}