Changeset 6248 in josm for trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
- Timestamp:
- 2013-09-23T16:47:50+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
r6087 r6248 7 7 import java.net.InetSocketAddress; 8 8 import java.net.Proxy; 9 import java.net.Proxy.Type; 9 10 import java.net.ProxySelector; 10 11 import java.net.SocketAddress; 11 12 import java.net.URI; 12 import java.net.Proxy.Type;13 13 import java.util.Collections; 14 14 import java.util.List; … … 79 79 port = Integer.parseInt(value); 80 80 } catch (NumberFormatException e) { 81 System.err.println(tr("Unexpected format for port number in in preference ''{0}''. Got ''{1}''.", property, value));82 System.err.println(tr("The proxy will not be used."));81 Main.error(tr("Unexpected format for port number in in preference ''{0}''. Got ''{1}''.", property, value)); 82 Main.error(tr("The proxy will not be used.")); 83 83 return 0; 84 84 } 85 85 if (port <= 0 || port > 65535) { 86 System.err.println(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port));87 System.err.println(tr("The proxy will not be used."));86 Main.error(tr("Illegal port number in preference ''{0}''. Got {1}.", property, port)); 87 Main.error(tr("The proxy will not be used.")); 88 88 return 0; 89 89 } … … 102 102 proxyPolicy= ProxyPolicy.fromName(value); 103 103 if (proxyPolicy == null) { 104 System.err.println(tr("Warning: unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.", ProxyPreferencesPanel.PROXY_POLICY, value));104 Main.warn(tr("Unexpected value for preference ''{0}'' found. Got ''{1}''. Will use no proxy.", ProxyPreferencesPanel.PROXY_POLICY, value)); 105 105 proxyPolicy = ProxyPolicy.NO_PROXY; 106 106 } … … 113 113 httpProxySocketAddress = null; 114 114 if (proxyPolicy.equals(ProxyPolicy.USE_HTTP_PROXY)) { 115 System.err.println(tr("Warning:Unexpected parameters for HTTP proxy. Got host ''{0}'' and port ''{1}''.", host, port));116 System.err.println(tr("The proxy will not be used."));115 Main.warn(tr("Unexpected parameters for HTTP proxy. Got host ''{0}'' and port ''{1}''.", host, port)); 116 Main.warn(tr("The proxy will not be used.")); 117 117 } 118 118 } … … 125 125 socksProxySocketAddress = null; 126 126 if (proxyPolicy.equals(ProxyPolicy.USE_SOCKS_PROXY)) { 127 System.err.println(tr("Warning:Unexpected parameters for SOCKS proxy. Got host ''{0}'' and port ''{1}''.", host, port));128 System.err.println(tr("The proxy will not be used."));127 Main.warn(tr("Unexpected parameters for SOCKS proxy. Got host ''{0}'' and port ''{1}''.", host, port)); 128 Main.warn(tr("The proxy will not be used.")); 129 129 } 130 130 } … … 133 133 @Override 134 134 public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { 135 // Just log something. The network stack will also throw an exception which will be caught 136 // somewhere else 135 // Just log something. The network stack will also throw an exception which will be caught somewhere else 137 136 // 138 System.out.println(tr("Error:Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}", sa.toString(), uri.toString(), ioe.toString()));137 Main.error(tr("Connection to proxy ''{0}'' for URI ''{1}'' failed. Exception was: {2}", sa.toString(), uri.toString(), ioe.toString())); 139 138 } 140 139 … … 145 144 case USE_SYSTEM_SETTINGS: 146 145 if (!JVM_WILL_USE_SYSTEM_PROXIES) { 147 System.err.println(tr("Warning: 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."));146 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.")); 148 147 return Collections.singletonList(Proxy.NO_PROXY); 149 148 }
Note:
See TracChangeset
for help on using the changeset viewer.