diff --git a/bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java b/bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java index 5b0aecf214a..0a6ea07d0b6 100644 --- a/bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java +++ b/bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java @@ -803,22 +803,20 @@ public int open() { } /** - * Runs the event loop for the given shell. + * Runs the event loop for shell. + *
+ * This method assumes that parameter is not null. + *
* * @param loopShell - * the shell + * the shell */ - private void runEventLoop(Shell loopShell) { + private static void runEventLoop(Shell loopShell) { - //Use the display provided by the shell if possible Display display; - if (shell == null) { - display = Display.getCurrent(); - } else { - display = loopShell.getDisplay(); - } + display = loopShell.getDisplay(); - while (loopShell != null && !loopShell.isDisposed()) { + while (!loopShell.isDisposed()) { try { if (!display.readAndDispatch()) { display.sleep();