From 992432a0e2b5e1c510bee246bf4c3990f388c5ea Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 19 Mar 2019 22:43:48 +0100 Subject: JavaFX: Remove JFXAccessor redundancy --- .../jogamp/nativewindow/javafx/JFXAccessor.java | 28 ++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java index d52f59181..bffabdd5a 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/javafx/JFXAccessor.java @@ -161,25 +161,23 @@ public class JFXAccessor { Platform.runLater(task); } else { final RunnableTask rTask = new RunnableTask(task, - wait ? rTaskLock : null, + rTaskLock, true /* always catch and report Exceptions, don't disturb EDT */, - wait ? null : System.err); + null); Platform.runLater(rTask); - if( wait ) { - try { - while( rTask.isInQueue() ) { - rTaskLock.wait(); // free lock, allow execution of rTask - } - } catch (final InterruptedException ie) { - throw new InterruptedRuntimeException(ie); + try { + while( rTask.isInQueue() ) { + rTaskLock.wait(); // free lock, allow execution of rTask } - final Throwable throwable = rTask.getThrowable(); - if(null!=throwable) { - if(throwable instanceof NativeWindowException) { - throw (NativeWindowException)throwable; - } - throw new RuntimeException(throwable); + } catch (final InterruptedException ie) { + throw new InterruptedRuntimeException(ie); + } + final Throwable throwable = rTask.getThrowable(); + if(null!=throwable) { + if(throwable instanceof NativeWindowException) { + throw (NativeWindowException)throwable; } + throw new RuntimeException(throwable); } } } -- cgit v1.2.3