Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-11-16 14:50:25 +0000
committerAlexander Kurtakov2017-11-16 14:50:25 +0000
commitba9df5d7d9c6b85607bb3aaceb37feff9ee7bc69 (patch)
tree72519fcb99f55d2798ac90a7886347944d14c6d3
parent915f949a6dd991dd486eac774b331effbd841dc3 (diff)
downloadeclipse.platform.ua-I20171120-2000.tar.gz
eclipse.platform.ua-I20171120-2000.tar.xz
eclipse.platform.ua-I20171120-2000.zip
Bundle requires Java 1.8 so no need for reflection to use it. Change-Id: Idd70b25e97f9c435f30cd2bb538d41d159773c43 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/EclipseRSSViewer.java14
1 files changed, 1 insertions, 13 deletions
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/EclipseRSSViewer.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/EclipseRSSViewer.java
index fa50f2b88..23cbc729e 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/EclipseRSSViewer.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/EclipseRSSViewer.java
@@ -15,7 +15,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
-import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
@@ -498,7 +497,7 @@ public class EclipseRSSViewer implements IIntroContentProvider {
URLConnection conn = url.openConnection();
// set connection timeout to 6 seconds
- setTimeout(conn, SOCKET_TIMEOUT); // Connection timeout to 6 seconds
+ conn.setConnectTimeout(SOCKET_TIMEOUT); // Connection timeout to 6 seconds
conn.connect();
try (InputStream in = url.openStream()) {
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
@@ -517,17 +516,6 @@ public class EclipseRSSViewer implements IIntroContentProvider {
}
}
-
- private void setTimeout(URLConnection conn, int milliseconds) {
- Class<? extends URLConnection> conClass = conn.getClass();
- try {
- Method timeoutMethod = conClass.getMethod(
- "setConnectTimeout", new Class[]{ int.class } ); //$NON-NLS-1$
- timeoutMethod.invoke(conn, new Object[] { Integer.valueOf(milliseconds)} );
- } catch (Exception e) {
- // If running on a 1.4 JRE an exception is expected, fall through
- }
- }
}
private class TimeoutThread extends Thread

Back to the top