Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-09-28 12:19:18 -0400
committerslewis2008-09-28 12:19:18 -0400
commited5735c77db822c1ba0d0ab321ad0694fcb835ee (patch)
tree632cab5618ca562e54166b8c7dcd45a870798090 /providers/bundles/org.eclipse.ecf.provider.xmpp
parentdfb2119ed580827e6a8e03ffc3341cdd76ccda8e (diff)
downloadorg.eclipse.ecf-ed5735c77db822c1ba0d0ab321ad0694fcb835ee.tar.gz
org.eclipse.ecf-ed5735c77db822c1ba0d0ab321ad0694fcb835ee.tar.xz
org.eclipse.ecf-ed5735c77db822c1ba0d0ab321ad0694fcb835ee.zip
Fix for unauthorized use of String.replace.
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.xmpp')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java
index 3c8ac290c..8fff5cd6c 100644
--- a/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java
+++ b/providers/bundles/org.eclipse.ecf.provider.xmpp/src/org/eclipse/ecf/provider/xmpp/identity/XMPPID.java
@@ -17,6 +17,7 @@ import java.util.Iterator;
import org.eclipse.ecf.core.identity.BaseID;
import org.eclipse.ecf.core.identity.Namespace;
+import org.eclipse.ecf.core.util.StringUtils;
import org.eclipse.ecf.internal.provider.xmpp.Messages;
import org.eclipse.ecf.presence.IFQID;
import org.eclipse.ecf.presence.im.IChatID;
@@ -39,8 +40,8 @@ public class XMPPID extends BaseID implements IChatID, IFQID {
}
}
- public CharSequence getAsCharSequence() {
- return buf;
+ public String getAsString() {
+ return buf.toString();
}
}
@@ -67,7 +68,7 @@ public class XMPPID extends BaseID implements IChatID, IFQID {
for (final Iterator i = escapeTable.keySet().iterator(); i.hasNext();) {
final String key = (String) i.next();
final XMPPEscape escape = (XMPPEscape) escapeTable.get(key);
- node = node.replace(new StringBuffer(key), escape.getAsCharSequence());
+ node = StringUtils.replaceAll(node, key, escape.getAsString());
}
return node;
}
@@ -75,7 +76,7 @@ public class XMPPID extends BaseID implements IChatID, IFQID {
static String fixPercentEscape(String src) {
if (src == null)
return null;
- return src.replaceAll("%", "%25");
+ return StringUtils.replaceAll(src, "%", "%25");
}
public static String unfixEscapeInNode(String node) {
@@ -84,7 +85,7 @@ public class XMPPID extends BaseID implements IChatID, IFQID {
for (final Iterator i = escapeTable.keySet().iterator(); i.hasNext();) {
final String key = (String) i.next();
final XMPPEscape escape = (XMPPEscape) escapeTable.get(key);
- node = node.replace(escape.getAsCharSequence(), new StringBuffer(key));
+ node = StringUtils.replaceAll(node, escape.getAsString(), key);
}
return node;
}

Back to the top