Skip to content

Commit 495424b

Browse files
committed
Made the runEventLoop() function static. Removed the loopshell parameter and directly referenced shell. Updated the runEventLoop() contract for clarification.
1 parent 1d2149c commit 495424b

File tree

1 file changed

+8
-10
lines changed
  • bundles/org.eclipse.jface/src/org/eclipse/jface/window

1 file changed

+8
-10
lines changed

bundles/org.eclipse.jface/src/org/eclipse/jface/window/Window.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -803,22 +803,20 @@ public int open() {
803803
}
804804

805805
/**
806-
* Runs the event loop for the given shell.
806+
* Runs the event loop for shell.
807+
* <p>
808+
* This method assumes that parameter is not null.
809+
* </p>
807810
*
808811
* @param loopShell
809-
* the shell
812+
* the shell
810813
*/
811-
private void runEventLoop(Shell loopShell) {
814+
private static void runEventLoop(Shell loopShell) {
812815

813-
//Use the display provided by the shell if possible
814816
Display display;
815-
if (shell == null) {
816-
display = Display.getCurrent();
817-
} else {
818-
display = loopShell.getDisplay();
819-
}
817+
display = loopShell.getDisplay();
820818

821-
while (loopShell != null && !loopShell.isDisposed()) {
819+
while (!loopShell.isDisposed()) {
822820
try {
823821
if (!display.readAndDispatch()) {
824822
display.sleep();

0 commit comments

Comments
 (0)