On Thu, 16 Feb 2023 19:12:47 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> src/java.desktop/share/classes/javax/swing/SwingWorker.java line 308:
>> 
>>> 306:                         } finally {
>>> 307:                             doneEDT();
>>> 308:                             setState(StateValue.DONE);
>> 
>> 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.
>
>> 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.

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

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

Reply via email to