From 6157a3ce2c026e59f41fb0a0abcb2edb7fed2e3e Mon Sep 17 00:00:00 2001 From: Ryan Gustafson Date: Fri, 1 May 2009 04:53:57 +0000 Subject: [PATCH] Use StringUtils.replaceString, instead of String.replace. git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@6931 51baf565-9d33-0410-a72c-fc3788e3496d --- .../pmd/lang/rule/AbstractRuleViolationFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmd/src/net/sourceforge/pmd/lang/rule/AbstractRuleViolationFactory.java b/pmd/src/net/sourceforge/pmd/lang/rule/AbstractRuleViolationFactory.java index 16dfbcf947..b8d1899fcd 100644 --- a/pmd/src/net/sourceforge/pmd/lang/rule/AbstractRuleViolationFactory.java +++ b/pmd/src/net/sourceforge/pmd/lang/rule/AbstractRuleViolationFactory.java @@ -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;