Use StringUtils.replaceString, instead of String.replace.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@6931 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Ryan Gustafson
2009-05-01 04:53:57 +00:00
parent 24cd90a0c1
commit 6157a3ce2c

View File

@ -6,6 +6,7 @@ import net.sourceforge.pmd.Rule;
import net.sourceforge.pmd.RuleContext;
import net.sourceforge.pmd.RuleViolation;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.util.StringUtil;
public abstract class AbstractRuleViolationFactory implements RuleViolationFactory {
@ -15,7 +16,7 @@ public abstract class AbstractRuleViolationFactory implements RuleViolationFacto
final String formattedMessage;
if (message != null) {
// Escape PMD specific variable message format, specifically the { in the ${, so MessageFormat doesn't bitch.
final String escapedMessage = message.replace("${", "$'{'");
final String escapedMessage = StringUtil.replaceString(message, "${", "$'{'");
formattedMessage = MessageFormat.format(escapedMessage, args != null ? args : NO_ARGS);
} else {
formattedMessage = message;