diff options
author | Lars Vogel | 2017-10-18 13:43:40 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-10-18 15:10:48 +0000 |
commit | 56a7b0a5c00770a33b2991d79474189368ebd528 (patch) | |
tree | 47faddb46bfd699671fa4948870322a63048ff32 | |
parent | e9efcb484933af8e5b6167b5d749a20e1c20c8ef (diff) | |
download | eclipse.platform.team-56a7b0a5c00770a33b2991d79474189368ebd528.tar.gz eclipse.platform.team-56a7b0a5c00770a33b2991d79474189368ebd528.tar.xz eclipse.platform.team-56a7b0a5c00770a33b2991d79474189368ebd528.zip |
Bug 526221 - Replace StringUtil#replace with String.replaceS4_8_0_M3aS4_8_0_M3I20171107-2000I20171106-2000I20171106-0630I20171105-2000I20171104-2025I20171104-1500I20171103-2000I20171103-1105I20171103-0715I20171103-0405I20171102-2000I20171101-2000I20171031-2000I20171030-2000I20171030-0400I20171029-2000I20171028-1500I20171027-2340I20171027-2000I20171025-2000I20171025-0800I20171024-2000I20171024-0800I20171023-2000I20171023-0800I20171022-2000I20171022-0800I20171021-1500I20171020-2000I20171019-2000I20171018-2000
Change-Id: If23802a4ae27a82ea3502b2869ea6b2e0668c6ef
Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
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$ } |