diff options
2 files changed, 1 insertions, 31 deletions
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java index 7d78b38d1..d9ec6eabc 100644 --- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java +++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/StringUtil.java @@ -70,36 +70,6 @@ public class StringUtil { return sequence1.equals(sequence2); } - /** - * Replace within <code>source</code> the occurrences of <code>from</code> - * with <code>to</code>.<br> - * <b>Note:</b> This has the same behavior as the - * <code>String.replace()</code> method within JDK 1.5. - * - * @param source - * @param from - * @param to - * @return the substituted string - */ - public static String replace(String source, String from, String to) { - if (from.length() == 0) - return source; - StringBuilder buffer = new StringBuilder(); - int current = 0; - int pos = 0; - while (pos != -1) { - pos = source.indexOf(from, current); - if (pos == -1) { - buffer.append(source.substring(current)); - } else { - buffer.append(source.substring(current, pos)); - buffer.append(to); - current = pos + from.length(); - } - } - return buffer.toString(); - } - public static boolean hostMatchesFilter(String host, String filter) { String suffixMatchingFilter = "*" + filter; //$NON-NLS-1$ StringMatcher matcher = new StringMatcher(suffixMatchingFilter, true, false); diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java index 446078371..71867b0d6 100644 --- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java +++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyBypass.java @@ -91,7 +91,7 @@ public class ProxyBypass { } public String[] getNonProxiedHosts() { - String ret = StringUtil.replace(proxyBypass, "|", ";"); //$NON-NLS-1$ //$NON-NLS-2$ + String ret = proxyBypass.replace("|", ";"); //$NON-NLS-1$ //$NON-NLS-2$ return StringUtil.split(ret, new String[] { ";" }); //$NON-NLS-1$ } |