Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2011-09-22 22:12:14 +0000
committerChris Goldthorpe2011-09-22 22:12:14 +0000
commitb06bb6f49deeb16c60de022520a4bef8f8a62cb2 (patch)
treee753b3fd0ca895602f35a9c193cbcbc5a8b87c68 /org.eclipse.ui.intro
parentea8ef6e0b7627dd1d33106abd790d645f54d67aa (diff)
downloadeclipse.platform.ua-b06bb6f49deeb16c60de022520a4bef8f8a62cb2.tar.gz
eclipse.platform.ua-b06bb6f49deeb16c60de022520a4bef8f8a62cb2.tar.xz
eclipse.platform.ua-b06bb6f49deeb16c60de022520a4bef8f8a62cb2.zip
Bug 358675 - [Intro] Remove unnecessary code which used Java reflection
Diffstat (limited to 'org.eclipse.ui.intro')
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/StringUtil.java22
1 files changed, 5 insertions, 17 deletions
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/StringUtil.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/StringUtil.java
index c03a01ea5..f963bdf53 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/StringUtil.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/StringUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2011 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
@@ -11,7 +11,6 @@
package org.eclipse.ui.internal.intro.impl.util;
import java.io.UnsupportedEncodingException;
-import java.lang.reflect.Method;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
@@ -67,24 +66,13 @@ public class StringUtil {
}
}
- /*
- * Helper method for URLDecoder#decode to handle the case where we
- * might be running on Foundation class libraries instead of 1.4.
- */
public static String decode(String s, String enc) throws UnsupportedEncodingException {
try {
return URLDecoder.decode(s, enc);
- } catch (NoSuchMethodError e) {
- // not running 1.4 so try the old method without an encoding
- try {
- // use reflection to avoid deprecation warning
- Method m = URLDecoder.class.getMethod("decode", new Class[] { String.class }); //$NON-NLS-1$
- return (String)m.invoke(null, new Object[] {s});
- }
- catch (Exception ex) {
- // fall back to original string
- return s;
- }
+ }
+ catch (Exception ex) {
+ // fall back to original string
+ return s;
}
}

Back to the top