Quote string replacements to avoid pattern issues
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ public class ParameterizedCommandExceptionType implements CommandExceptionType {
|
|||||||
final Matcher matcher = PATTERN.matcher(message);
|
final Matcher matcher = PATTERN.matcher(message);
|
||||||
final StringBuffer result = new StringBuffer();
|
final StringBuffer result = new StringBuffer();
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
matcher.appendReplacement(result, exception.getData().get(matcher.group(1)).toString());
|
matcher.appendReplacement(result, Matcher.quoteReplacement(exception.getData().get(matcher.group(1)).toString()));
|
||||||
}
|
}
|
||||||
matcher.appendTail(result);
|
matcher.appendTail(result);
|
||||||
return result.toString();
|
return result.toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user