diff options
author | Alexander Kurtakov | 2017-11-16 14:50:25 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-11-16 14:50:25 +0000 |
commit | ba9df5d7d9c6b85607bb3aaceb37feff9ee7bc69 (patch) | |
tree | 72519fcb99f55d2798ac90a7886347944d14c6d3 /org.eclipse.ui.intro | |
parent | 915f949a6dd991dd486eac774b331effbd841dc3 (diff) | |
download | eclipse.platform.ua-ba9df5d7d9c6b85607bb3aaceb37feff9ee7bc69.tar.gz eclipse.platform.ua-ba9df5d7d9c6b85607bb3aaceb37feff9ee7bc69.tar.xz eclipse.platform.ua-ba9df5d7d9c6b85607bb3aaceb37feff9ee7bc69.zip |
Bug 527352 - Use URLConnection.setConnectTimeout method directlyI20171121-0020I20171120-2225I20171120-2000I20171119-2000I20171118-1500I20171117-2000I20171116-2000
Bundle requires Java 1.8 so no need for reflection to use it.
Change-Id: Idd70b25e97f9c435f30cd2bb538d41d159773c43
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.ui.intro')
-rw-r--r-- | org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/EclipseRSSViewer.java | 14 |
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 |