Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-10-18 09:35:58 +0000
committerAlexander Kurtakov2017-10-18 09:47:22 +0000
commit1484463cd0ef85ff2c17e5ccc8ea71c64cded5e4 (patch)
tree0f1ae16d1272ffd348a7d1eb3ac3ac8b316da11a
parent7914a96e80ae2aa5d301e7fbf77182514b16848f (diff)
downloadeclipse.platform-1484463cd0ef85ff2c17e5ccc8ea71c64cded5e4.tar.gz
eclipse.platform-1484463cd0ef85ff2c17e5ccc8ea71c64cded5e4.tar.xz
eclipse.platform-1484463cd0ef85ff2c17e5ccc8ea71c64cded5e4.zip
Bug 526201 - Remove UpdateURLDecoder
All this class was doing is ignore the encoding if on old Java, which can no longer happen. Change-Id: Ia620b6e994948a16c6d6f92bedc276fffb604311 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java3
-rw-r--r--update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/UpdateURLDecoder.java36
-rw-r--r--update/org.eclipse.update.core/META-INF/MANIFEST.MF2
-rw-r--r--update/org.eclipse.update.core/src/org/eclipse/update/standalone/InstallCommand.java6
-rw-r--r--update/org.eclipse.update.core/src/org/eclipse/update/standalone/SearchCommand.java5
5 files changed, 8 insertions, 44 deletions
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java
index 2e10245c9..258eff5d9 100644
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java
+++ b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/PlatformConfiguration.java
@@ -25,6 +25,7 @@ import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
+import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
@@ -267,7 +268,7 @@ public class PlatformConfiguration implements IPlatformConfiguration, IConfigura
try {
//PAL foundation
//key = URLDecoder.decode(key, "UTF-8"); //$NON-NLS-1$
- key = UpdateURLDecoder.decode(key, "UTF-8"); //$NON-NLS-1$
+ key = URLDecoder.decode(key, "UTF-8"); //$NON-NLS-1$
} catch (UnsupportedEncodingException e) {
// ignore
}
diff --git a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/UpdateURLDecoder.java b/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/UpdateURLDecoder.java
deleted file mode 100644
index 633b49f1d..000000000
--- a/update/org.eclipse.update.configurator/src/org/eclipse/update/internal/configurator/UpdateURLDecoder.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.update.internal.configurator;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-
-public class UpdateURLDecoder {
- static boolean init=false;
- static boolean useEnc=true;
-
- public static String decode(String s, String enc) throws UnsupportedEncodingException {
- if (!init) {
- init = true;
- try {
- return URLDecoder.decode(s, enc);
- } catch (NoSuchMethodError e) {
- useEnc=false;
- }
- }
-
- if (useEnc) {
- return URLDecoder.decode(s, enc);
- }
- return URLDecoder.decode(s);
- }
-
-}
diff --git a/update/org.eclipse.update.core/META-INF/MANIFEST.MF b/update/org.eclipse.update.core/META-INF/MANIFEST.MF
index 4b68ee01a..f092dac2a 100644
--- a/update/org.eclipse.update.core/META-INF/MANIFEST.MF
+++ b/update/org.eclipse.update.core/META-INF/MANIFEST.MF
@@ -23,7 +23,7 @@ Export-Package: org.eclipse.update.configuration,
org.eclipse.update.search,
org.eclipse.update.standalone
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.update.configurator;bundle-version="[3.1.0,4.0.0)",
+ org.eclipse.update.configurator;bundle-version="[3.4.0,4.0.0)",
org.eclipse.core.net;bundle-version="[1.0.0,2.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.4,
diff --git a/update/org.eclipse.update.core/src/org/eclipse/update/standalone/InstallCommand.java b/update/org.eclipse.update.core/src/org/eclipse/update/standalone/InstallCommand.java
index 4dbc52570..53ea8bfff 100644
--- a/update/org.eclipse.update.core/src/org/eclipse/update/standalone/InstallCommand.java
+++ b/update/org.eclipse.update.core/src/org/eclipse/update/standalone/InstallCommand.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -13,6 +13,7 @@ package org.eclipse.update.standalone;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLDecoder;
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
@@ -27,7 +28,6 @@ import org.eclipse.update.core.ISite;
import org.eclipse.update.core.SiteManager;
import org.eclipse.update.core.Utilities;
import org.eclipse.update.core.VersionedIdentifier;
-import org.eclipse.update.internal.configurator.UpdateURLDecoder;
import org.eclipse.update.internal.core.Messages;
import org.eclipse.update.internal.core.UpdateCore;
import org.eclipse.update.internal.core.UpdateManagerUtils;
@@ -80,7 +80,7 @@ public class InstallCommand extends ScriptedCommand {
this.version = version;
//PAL foundation
- this.remoteSiteURL = new URL(UpdateURLDecoder.decode(fromSite, "UTF-8")); //$NON-NLS-1$
+ this.remoteSiteURL = new URL(URLDecoder.decode(fromSite, "UTF-8")); //$NON-NLS-1$
// Get site to install to
targetSite = getTargetSite(toSite);
diff --git a/update/org.eclipse.update.core/src/org/eclipse/update/standalone/SearchCommand.java b/update/org.eclipse.update.core/src/org/eclipse/update/standalone/SearchCommand.java
index a6c989d7c..6bc9acc9a 100644
--- a/update/org.eclipse.update.core/src/org/eclipse/update/standalone/SearchCommand.java
+++ b/update/org.eclipse.update.core/src/org/eclipse/update/standalone/SearchCommand.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -14,7 +14,6 @@ import java.net.*;
import org.eclipse.core.runtime.*;
import org.eclipse.update.core.*;
-import org.eclipse.update.internal.configurator.UpdateURLDecoder;
import org.eclipse.update.internal.core.*;
import org.eclipse.update.internal.search.*;
import org.eclipse.update.search.*;
@@ -40,7 +39,7 @@ public class SearchCommand extends ScriptedCommand {
public SearchCommand(String fromSite) {
try {
//PAL foundation
- this.remoteSiteURL = new URL(UpdateURLDecoder.decode(fromSite, "UTF-8")); //$NON-NLS-1$
+ this.remoteSiteURL = new URL(URLDecoder.decode(fromSite, "UTF-8")); //$NON-NLS-1$
UpdateSearchScope searchScope = new UpdateSearchScope();
searchScope.addSearchSite(
"remoteSite", //$NON-NLS-1$

Back to the top