- Timestamp:
- 2014-01-17T19:06:54+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
r6523 r6714 26 26 */ 27 27 public class DefaultProxySelector extends ProxySelector { 28 29 private static final List<Proxy> NO_PROXY_LIST = Collections.singletonList(Proxy.NO_PROXY); 30 28 31 /** 29 32 * The {@link ProxySelector} provided by the JDK will retrieve proxy information … … 184 187 @Override 185 188 public List<Proxy> select(URI uri) { 186 Proxy proxy; 189 if (uri != null && "localhost".equals(uri.getHost())) { 190 return NO_PROXY_LIST; 191 } 187 192 switch(proxyPolicy) { 188 193 case USE_SYSTEM_SETTINGS: 189 194 if (!JVM_WILL_USE_SYSTEM_PROXIES) { 190 195 Main.warn(tr("The JVM is not configured to lookup proxies from the system settings. The property ''java.net.useSystemProxies'' was missing at startup time. Will not use a proxy.")); 191 return Collections.singletonList(Proxy.NO_PROXY);196 return NO_PROXY_LIST; 192 197 } 193 198 // delegate to the former proxy selector 194 List<Proxy> ret = delegate.select(uri); 195 return ret; 199 return delegate.select(uri); 196 200 case NO_PROXY: 197 return Collections.singletonList(Proxy.NO_PROXY);201 return NO_PROXY_LIST; 198 202 case USE_HTTP_PROXY: 199 203 if (httpProxySocketAddress == null) 200 return Collections.singletonList(Proxy.NO_PROXY); 201 proxy = new Proxy(Type.HTTP, httpProxySocketAddress); 202 return Collections.singletonList(proxy); 204 return NO_PROXY_LIST; 205 return Collections.singletonList(new Proxy(Type.HTTP, httpProxySocketAddress)); 203 206 case USE_SOCKS_PROXY: 204 207 if (socksProxySocketAddress == null) 205 return Collections.singletonList(Proxy.NO_PROXY); 206 proxy = new Proxy(Type.SOCKS, socksProxySocketAddress); 207 return Collections.singletonList(proxy); 208 return NO_PROXY_LIST; 209 return Collections.singletonList(new Proxy(Type.SOCKS, socksProxySocketAddress)); 208 210 } 209 211 // should not happen
Note:
See TracChangeset
for help on using the changeset viewer.