RFR: 8081474: SwingWorker calls 'done' before the 'doInBackground' is finished [v21]

Alexey Ivanov aivanov at openjdk.org
Fri Feb 17 15:48:05 UTC 2023


On Thu, 16 Feb 2023 21:19:59 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>>> Can the test checks the case when the listener called from "setState" will throw an exception, I think some of the previous iterations of the fix will not work in this case.
>> 
>> This is not a new problem and _is not introduced_ by Prasanta's fix.
>> 
>> I also found it while I was testing his changes and ran the test.
>> 
>> If a listener throws an exception, all the following runnables which are already accumulated in `AccumulativeRunnable` are not run.
>> 
>> I have already written a test for this case and I will submit a bug. It must not be included here.
>
> I think the previous iteration of the fix was not run the doneEDT if the setState throws an exception, while the current version, and initial code always run it.

@mrserb I have submitted [JDK-8302778](https://bugs.openjdk.org/browse/JDK-8302778): _SwingWorker loses notifications if a handler throws an exception_.

The provided [LostNotifications.java](https://github.com/aivanov-jdk/jdk/blob/e4042edc654849a992710a0e0d23ec8df4fe14c4/test/jdk/javax/swing/SwingWorker/LostNotifications.java) test fails on 8, 11, 17 and 21.

It proves that this problem is not related to the current fix, however, the test for this issue has uncovered it.

-------------

PR: https://git.openjdk.org/jdk/pull/11940



More information about the client-libs-dev mailing list