Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2020-02-18 06:32:16 +0000
committerEd Merks2020-02-18 09:37:53 +0000
commit527e77fe2ce488aa544a015da2241859af63ace3 (patch)
treed0d6c2133a7f2930529da4e9e3d39ebd7ad189ed
parent62d1efb13557d24da5b7c2e80a9de9fabef73455 (diff)
downloadeclipse.platform.team-I20200218-0600.tar.gz
eclipse.platform.team-I20200218-0600.tar.xz
eclipse.platform.team-I20200218-0600.zip
if Manual proxy is configured ProxyManager should not assume that uri.getHost() returns a non-null value. Specifically a valid jar: URI will always have a null host. Also eliminate unused imports so that build passes. Change-Id: I8ca9446e888b132c5f88f8cdc14eb9133a3a0b48 Signed-off-by: Ed Merks <ed.merks@gmail.com>
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java
index d7453ea7f..5e240e046 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyManager.java
@@ -318,10 +318,13 @@ public class ProxyManager implements IProxyService, IPreferenceChangeListener {
}
private boolean isHostFiltered(URI uri) {
- String[] filters = getNonProxiedHosts();
- for (String filter : filters) {
- if (StringUtil.hostMatchesFilter(uri.getHost(), filter))
- return true;
+ String host = uri.getHost();
+ if (host != null) {
+ String[] filters = getNonProxiedHosts();
+ for (String filter : filters) {
+ if (StringUtil.hostMatchesFilter(host, filter))
+ return true;
+ }
}
return false;
}
@@ -422,9 +425,12 @@ public class ProxyManager implements IProxyService, IPreferenceChangeListener {
@Override
public IProxyData[] select(URI uri) {
- IProxyData data = getProxyDataForHost(uri.getHost(), uri.getScheme());
- if (data != null) {
- return resolveType(new IProxyData[] { data });
+ String host = uri.getHost();
+ if (host != null) {
+ IProxyData data = getProxyDataForHost(host, uri.getScheme());
+ if (data != null) {
+ return resolveType(new IProxyData[] { data });
+ }
}
return new IProxyData[0];
}

Back to the top