aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/org
diff options
context:
space:
mode:
authorBenjamin, Max <max.benjamin@att.com>2019-09-10 13:52:53 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2019-09-10 13:52:53 -0400
commit193105ce3a95fb1682fef0a17c081c2e6ebb8ff5 (patch)
tree8656e25b5c67254c7debec3143cc1d1d1cdb3122 /common/src/main/java/org
parentcd7f7a357a4a85de096f3ce7b6d20d0df655af79 (diff)
error message formatter now handles percent
error message formatter now handles percent encoding Issue-ID: SO-2303 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: If4784ab54023b1df43eb7ee266a2797c9a12731b
Diffstat (limited to 'common/src/main/java/org')
-rw-r--r--common/src/main/java/org/onap/so/client/aai/AAIErrorFormatter.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIErrorFormatter.java b/common/src/main/java/org/onap/so/client/aai/AAIErrorFormatter.java
index 2fe3910486..e255b297ed 100644
--- a/common/src/main/java/org/onap/so/client/aai/AAIErrorFormatter.java
+++ b/common/src/main/java/org/onap/so/client/aai/AAIErrorFormatter.java
@@ -50,6 +50,8 @@ public class AAIErrorFormatter {
}
protected String format(String s, List<String> variables) {
- return String.format(s.replaceAll("%(\\d+)", "%$1\\$s"), variables.toArray());
+ s = s.replaceAll("%(\\d(?!\\d))", "%$1\\$s");
+ s = s.replaceAll("%(\\d{2})", "%%$1");
+ return String.format(s, variables.toArray());
}
}