Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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