diff options
author | Alex Blewitt | 2020-07-04 13:03:06 +0000 |
---|---|---|
committer | Alex Blewitt | 2020-07-15 08:27:52 +0000 |
commit | 7f7dbae6777773c1b54c3c9864728b4215e19219 (patch) | |
tree | 43c2543c100648d7dc91e7c44e02952402925bf7 | |
parent | 494ada4f81a713f73c0b3e5dd2d71e572af6e21a (diff) | |
download | eclipse.platform.team-7f7dbae6777773c1b54c3c9864728b4215e19219.tar.gz eclipse.platform.team-7f7dbae6777773c1b54c3c9864728b4215e19219.tar.xz eclipse.platform.team-7f7dbae6777773c1b54c3c9864728b4215e19219.zip |
Bug 564923 - Do not display proxy warning on macOSY20200722-1200Y20200722-0040Y20200721-0610Y20200721-0450Y20200718-1200Y20200716-0820Y20200715-1200I20200723-1800I20200723-1030I20200723-0620I20200722-1800I20200722-1140I20200722-0610I20200721-1800I20200721-1400I20200721-0950I20200721-0610I20200721-0130I20200720-1800I20200720-0850I20200720-0020I20200719-2010I20200718-1800I20200717-1800I20200716-1800I20200715-1800
When running on macOS, a warning is shown on the console every time an
Eclipse application is launched:
> !ENTRY org.eclipse.core.net 1 0 2020-07-04 14:01:49.811
> !MESSAGE System property http.nonProxyHosts has been set to
> local|*.local|169.254/16|*.169.254/16 by an external source.
> This value will be overwritten using the values from the preferences
This warning is unnecessary, because the JVM automatically sets these
values on startup and the proxy setup then does exactly the same thing.
There appears to be a logic bug in that the path to verify that the
proxies are set that assumes the nonProxyHosts property is empty if the
proxies are disabled. However, that condition on macOS is not valid,
since the JVM itself will set this value even if the proxies aren't set.
Therefore, checking the field is empty on macOS isn't valid.
https://github.com/openjdk/jdk/blob/f37d9c8abca50b65ed232831a06d60c1d015013f/src/java.base/macosx/native/libjava/java_props_macosx.c#L449
For minimal impact, when running on macOS, pass the DO_NOT_VERIFY
instead of VERIFY_EMPTY so that this message is not generated
unnecessarily every time Eclipse launches.
Change-Id: I68e955677b347a6b62ef83cdb842c3aa15b203d8
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
-rw-r--r-- | bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java index d4e5c6d63..955bfb1e7 100644 --- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java +++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxyType.java @@ -533,7 +533,10 @@ public class ProxyType implements INodeChangeListener, IPreferenceChangeListener } public void initialize() { - updateSystemProperties(getProxyData(VERIFY_EMPTY)); + // On mac, the system proxy configuration is set by the JVM automatically + boolean isMac = "macosx".equals(System.getProperty("osgi.os")); //$NON-NLS-1$//$NON-NLS-2$ + int verify = isMac ? DO_NOT_VERIFY : VERIFY_EMPTY; + updateSystemProperties(getProxyData(verify)); preferenceManager.addNodeChangeListener(PREF_PROXY_DATA_NODE, this); preferenceManager.addPreferenceChangeListener(getPreferenceNode(), this); } |