Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-11-14 12:46:14 +0000
committerAlexander Kurtakov2017-11-14 12:46:14 +0000
commitbae0a314a0b62405bd9fd9103fdc04d7e710d3bd (patch)
tree113b9f214b2e4509d36d6dc877809c8128d84f28 /bundles
parentcb39d43edc678e2eac00bb0f93f55a4e0b25dc4a (diff)
downloadeclipse.platform.team-bae0a314a0b62405bd9fd9103fdc04d7e710d3bd.tar.gz
eclipse.platform.team-bae0a314a0b62405bd9fd9103fdc04d7e710d3bd.tar.xz
eclipse.platform.team-bae0a314a0b62405bd9fd9103fdc04d7e710d3bd.zip
Old preferences code migration for 7 years is good enough especially considering this is about proxies. Tracing options in launch configurations are totally useless. Change-Id: I0864684be8c857a263087ae07d5084c022bbece2 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/PreferenceManager.java33
1 files changed, 10 insertions, 23 deletions
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/PreferenceManager.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/PreferenceManager.java
index 77ea395ac..a8a4b1c04 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/PreferenceManager.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/PreferenceManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2010, 2011 IBM Corporation and others.
+* Copyright (c) 2010, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,13 +29,6 @@ public class PreferenceManager {
private static final String PREF_HAS_MIGRATED = "org.eclipse.core.net.hasMigrated"; //$NON-NLS-1$
- /**
- * Preference constants used by Update to record the HTTP proxy
- */
- private static String HTTP_PROXY_HOST = "org.eclipse.update.core.proxy.host"; //$NON-NLS-1$
- private static String HTTP_PROXY_PORT = "org.eclipse.update.core.proxy.port"; //$NON-NLS-1$
- private static String HTTP_PROXY_ENABLE = "org.eclipse.update.core.proxy.enable"; //$NON-NLS-1$
-
private static final int DEFAULT_INT = -1;
private static final String DEFAULT_STRING = null;
private static final boolean DEFAULT_BOOLEAN = false;
@@ -313,10 +306,9 @@ public class PreferenceManager {
// Only set the migration bit when initializing
if (isInitialize)
instanceScope.putBoolean(PREF_HAS_MIGRATED, true);
- Preferences updatePrefs = instanceScope.parent().node("org.eclipse.update.core"); //$NON-NLS-1$
- String httpProxyHost = getHostToMigrate(updatePrefs, isInitialize /* checkSystemProperties */);
- int port = getPortToMigrate(updatePrefs, isInitialize /* checkSystemProperties */);
- boolean httpProxyEnable = getEnablementToMigrate(updatePrefs, isInitialize /* checkSystemProperties */);
+ String httpProxyHost = getHostToMigrate(isInitialize /* checkSystemProperties */);
+ int port = getPortToMigrate(isInitialize /* checkSystemProperties */);
+ boolean httpProxyEnable = getEnablementToMigrate(isInitialize /* checkSystemProperties */);
if (httpProxyHost != null) {
ProxyData proxyData = new ProxyData(IProxyData.HTTP_PROXY_TYPE,
httpProxyHost, port, false, null);
@@ -333,23 +325,21 @@ public class PreferenceManager {
}
}
- private String getHostToMigrate(Preferences updatePrefs, boolean checkSystemProperties) {
- String httpProxyHost = updatePrefs.get(HTTP_PROXY_HOST, ""); //$NON-NLS-1$
+ private String getHostToMigrate(boolean checkSystemProperties) {
+ String httpProxyHost = ""; //$NON-NLS-1$
if (checkSystemProperties && "".equals(httpProxyHost)) { //$NON-NLS-1$
httpProxyHost = System.getProperty("http.proxyHost", ""); //$NON-NLS-1$ //$NON-NLS-2$
}
if ("".equals(httpProxyHost)) //$NON-NLS-1$
httpProxyHost = null;
- updatePrefs.remove(HTTP_PROXY_HOST);
return httpProxyHost;
}
- private int getPortToMigrate(Preferences updatePrefs, boolean checkSystemProperties) {
- String httpProxyPort = updatePrefs.get(HTTP_PROXY_PORT, ""); //$NON-NLS-1$
+ private int getPortToMigrate(boolean checkSystemProperties) {
+ String httpProxyPort = ""; //$NON-NLS-1$
if (checkSystemProperties && "".equals(httpProxyPort)) { //$NON-NLS-1$
httpProxyPort = System.getProperty("http.proxyPort", ""); //$NON-NLS-1$ //$NON-NLS-2$
}
- updatePrefs.remove(HTTP_PROXY_PORT);
int port = -1;
if (httpProxyPort != null && !"".equals(httpProxyPort)) //$NON-NLS-1$
try {
@@ -360,13 +350,10 @@ public class PreferenceManager {
return port;
}
- private boolean getEnablementToMigrate(Preferences updatePrefs, boolean checkSystemProperties) {
+ private boolean getEnablementToMigrate(boolean checkSystemProperties) {
boolean httpProxyEnable = false;
- if (checkSystemProperties && updatePrefs.get(HTTP_PROXY_ENABLE, null) == null) {
+ if (checkSystemProperties) {
httpProxyEnable = Boolean.getBoolean("http.proxySet"); //$NON-NLS-1$
- } else {
- httpProxyEnable = updatePrefs.getBoolean(HTTP_PROXY_ENABLE, false);
- updatePrefs.remove(HTTP_PROXY_ENABLE);
}
return httpProxyEnable;
}

Back to the top