Skip to content

Commit e15246c

Browse files
committed
Use try-with-resources
1 parent c20fea4 commit e15246c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BusyIndicator.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2024 Christoph Läubrich and others.
2+
* Copyright (c) 2024, 2026 Christoph Läubrich and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -95,8 +95,7 @@ public void testShowWhile() {
9595
@Test
9696
@Timeout(value = 30)
9797
public void testShowWhileWithFuture() {
98-
ExecutorService executor = Executors.newSingleThreadExecutor();
99-
try {
98+
try (ExecutorService executor = Executors.newSingleThreadExecutor()){
10099
Shell shell = new Shell();
101100
Display display = shell.getDisplay();
102101
Cursor busyCursor = display.getSystemCursor(SWT.CURSOR_WAIT);
@@ -129,8 +128,6 @@ public void testShowWhileWithFuture() {
129128
shell.dispose();
130129
while (!display.isDisposed() && display.readAndDispatch()) {
131130
}
132-
} finally {
133-
executor.shutdownNow();
134131
}
135132
}
136133

0 commit comments

Comments
 (0)