Pause object has a static ExecutorService that can't be shutdown
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Read org.assertj.swing.timing.Pause and trace the lifecycle of its static EXECUTOR_SERVICE. Reproduce the issue with the sample main method, then choose and validate a shutdown or common-pool approach; done means the example can finish without reflection and without lingering non-daemon threads.
Written by the indexing model from the issue text.
Description
org.assertj.swing.timing.Pause has an ExecutorService. It's static and cannot be closed. It means that we have non-daemon threads hanging in there and preventing the JVM to finish.
An example is
public static void main(String[] args) throws Exception {
Pause.pause(new Condition("Cond") {
@Override
public boolean test() {
return true;
}
});
Field field = Pause.class.getDeclaredField("EXECUTOR_SERVICE");
field.setAccessible(true);
ExecutorService service = (ExecutorService) field.get(null);
service.shutdownNow();
}
Without the reflection code at the end, it won't exit for a while.
The easiest solution is to add a static close() method to shutdown the pool. But I think the best is to change the code to rely on the commonPool, e.g. ForkJoinPool.commonPool().submit() or a CompletableFuture.
- Dominant language
- Java
- Stars
- 121
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from assertj/assertj-swing
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
assertj/assertj-swing#279 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
assertj/assertj-swing#278 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
assertj/assertj-swing#276 · 1 comment ·
-
Update unit test to avoid deprecated `ExpectedException.none()` by using `Assert.assertThrows()` Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
assertj/assertj-swing#275 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
assertj/assertj-swing#277 · 1 comment ·
All issues in assertj/assertj-swing
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/rocketmq-dashboard#4860 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·