aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-09-11 12:58:16 +0000
committerGerrit Code Review <gerrit@onap.org>2019-09-11 12:58:16 +0000
commit6164166521c11d2587b5a653e7cd146346e9e467 (patch)
tree3e4c90ba197948e9c5151a9dd7d27eec5e0f1fcf /common/src/main
parent862c7e03f4330d9ae8f9e73c912e74064294f9ce (diff)
parent193105ce3a95fb1682fef0a17c081c2e6ebb8ff5 (diff)
Merge "error message formatter now handles percent"
Diffstat (limited to 'common/src/main')
-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());
}
}