Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeb Ford-Reitz2014-04-04 09:31:16 +0000
committerZeb Ford-Reitz2014-04-04 13:23:31 +0000
commit792842fd0e59da56076352de4883170c41e95bbf (patch)
treec4dd0f6b485881846a3e157ccc8e53a3b454c856 /org.eclipse.jubula.rc.swing/src
parent66438dfa973b658d7aeab4c174a64c7a54161773 (diff)
downloadorg.eclipse.jubula.core-792842fd0e59da56076352de4883170c41e95bbf.tar.gz
org.eclipse.jubula.core-792842fd0e59da56076352de4883170c41e95bbf.tar.xz
org.eclipse.jubula.core-792842fd0e59da56076352de4883170c41e95bbf.zip
http://eclip.se/431975: EventFlusher does not use syncNativeQueue
Changes the reflective method parameter type from "Long" to "long". This should enable syncing the native queue for Java 7 and 8.
Diffstat (limited to 'org.eclipse.jubula.rc.swing/src')
-rw-r--r--org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/driver/EventFlusher.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/driver/EventFlusher.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/driver/EventFlusher.java
index e4c9f0a1f..f4bd90b27 100644
--- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/driver/EventFlusher.java
+++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/driver/EventFlusher.java
@@ -19,12 +19,17 @@ import java.util.List;
import org.apache.commons.lang.ArrayUtils;
import org.eclipse.jubula.rc.common.exception.RobotException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* This class is based on the code snippet posted on
* http://stackoverflow.com/questions/11042979/does-java-awt-robot-waitforidle-wait-for-events-to-be-dispatched
*/
public class EventFlusher {
+ /** logger */
+ private static final Logger LOG =
+ LoggerFactory.getLogger(EventFlusher.class);
/** the toolkit class name */
private static final String TOOLKIT_CLASS_NAME = "sun.awt.SunToolkit"; //$NON-NLS-1$
/** the native sync queue method */
@@ -34,7 +39,7 @@ public class EventFlusher {
/** the robot to use */
private final Robot m_robot;
/** the flush timeout to use */
- private final Long m_flushTimeout;
+ private final long m_flushTimeout;
/**
* indicates whether the default toolkit is compatible to the required
* toolkit implementation for native event flushing
@@ -51,7 +56,7 @@ public class EventFlusher {
*/
public EventFlusher(Robot robot, long flushTimeout) {
m_robot = robot;
- m_flushTimeout = new Long(flushTimeout);
+ m_flushTimeout = flushTimeout;
m_syncNativeQueue = null;
m_isSyncNativeQueueZeroArguments = true;
try {
@@ -70,8 +75,8 @@ public class EventFlusher {
String name = method.getName();
if ("syncNativeQueue".equals(name)) { //$NON-NLS-1$
List parameterTypes = Arrays.asList(
- method.getParameterTypes());
- if (Arrays.asList(new Object[] { Long.class })
+ method.getParameterTypes());
+ if (Arrays.asList(new Object[] { long.class })
.equals(parameterTypes)) {
m_isSyncNativeQueueZeroArguments = false;
} else if (parameterTypes.isEmpty()
@@ -141,11 +146,11 @@ public class EventFlusher {
new Object[] { m_flushTimeout });
}
} catch (IllegalArgumentException e) {
- throw new RobotException(e);
+ LOG.error("Error occurred while invoking syncNativeQueue.", e); //$NON-NLS-1$
} catch (IllegalAccessException e) {
- throw new RobotException(e);
+ LOG.error("Error occurred while invoking syncNativeQueue.", e); //$NON-NLS-1$
} catch (InvocationTargetException e) {
- throw new RobotException(e);
+ LOG.error("Error occurred while invoking syncNativeQueue.", e); //$NON-NLS-1$
}
}

Back to the top