diff options
author | Chris Goldthorpe | 2011-09-22 23:01:27 +0000 |
---|---|---|
committer | Chris Goldthorpe | 2011-09-22 23:01:27 +0000 |
commit | d9167980d227beb3c0fae203d39721a0ac391d4f (patch) | |
tree | 9a4122c1adf04b021b3849ff16faf9dcb23d745c /org.eclipse.ua.tests | |
parent | e6219a4b731ec3cb308bc7103c9f4069c4c69f12 (diff) | |
download | eclipse.platform.ua-d9167980d227beb3c0fae203d39721a0ac391d4f.tar.gz eclipse.platform.ua-d9167980d227beb3c0fae203d39721a0ac391d4f.tar.xz eclipse.platform.ua-d9167980d227beb3c0fae203d39721a0ac391d4f.zip |
Bug 358676 ( Part 2 of fix ) - [Test] Remove unnecessary reflection code
in org.eclipse.ua.tests
Diffstat (limited to 'org.eclipse.ua.tests')
-rw-r--r-- | org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerBinding.java | 18 | ||||
-rw-r--r-- | org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerInterrupt.java | 18 |
2 files changed, 8 insertions, 28 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerBinding.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerBinding.java index 329c36f5f..a859cf1b8 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerBinding.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerBinding.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 IBM Corporation and others. + * Copyright (c) 2010, 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 @@ -12,7 +12,6 @@ package org.eclipse.ua.tests.help.webapp; import java.io.InputStream; -import java.lang.reflect.Method; import java.net.InetAddress; import java.net.URL; import java.net.URLConnection; @@ -100,18 +99,9 @@ public class HelpServerBinding extends TestCase { } } - private void setTimeout(URLConnection conn, int milliseconds) { - Class conClass = conn.getClass(); - try { - Method timeoutMethod = conClass.getMethod( - "setConnectTimeout", new Class[]{ int.class } ); //$NON-NLS-1$ - timeoutMethod.invoke(conn, new Object[] { new Integer(milliseconds)} ); - Method readMethod = conClass.getMethod( - "setReadTimeout", new Class[]{ int.class } ); //$NON-NLS-1$ - readMethod.invoke(conn, new Object[] { new Integer(milliseconds)} ); - } catch (Exception e) { - // If running on a 1.4 JRE an exception is expected, fall through - } + private static void setTimeout(URLConnection conn, int milliseconds) { + conn.setConnectTimeout(milliseconds); + conn.setReadTimeout(milliseconds); } } diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerInterrupt.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerInterrupt.java index 3a20c7cc7..e0e3387b7 100644 --- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerInterrupt.java +++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/webapp/HelpServerInterrupt.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 IBM Corporation and others. + * Copyright (c) 2009, 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 @@ -12,7 +12,6 @@ package org.eclipse.ua.tests.help.webapp; import java.io.InputStream; -import java.lang.reflect.Method; import java.net.URL; import java.net.URLConnection; @@ -121,18 +120,9 @@ public class HelpServerInterrupt extends TestCase { } } - private void setTimeout(URLConnection conn, int milliseconds) { - Class conClass = conn.getClass(); - try { - Method timeoutMethod = conClass.getMethod( - "setConnectTimeout", new Class[]{ int.class } ); //$NON-NLS-1$ - timeoutMethod.invoke(conn, new Object[] { new Integer(milliseconds)} ); - Method readMethod = conClass.getMethod( - "setReadTimeout", new Class[]{ int.class } ); //$NON-NLS-1$ - readMethod.invoke(conn, new Object[] { new Integer(milliseconds)} ); - } catch (Exception e) { - // If running on a 1.4 JRE an exception is expected, fall through - } + private static void setTimeout(URLConnection conn, int milliseconds) { + conn.setConnectTimeout(milliseconds); + conn.setReadTimeout(milliseconds); } } |