On Thu, 16 Feb 2023 05:13:16 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

>> SwingWorker done() method [spec 
>> ](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/SwingWorker.java#L452)
>>  says "Executed on the Event Dispatch Thread after the doInBackground method 
>> is finished"
>> but there's no mechanism in place to honor that claim.
>> The 
>> [spec](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/SwingWorker.java#L289)
>> also says the state should be DONE after doInBackground() returns which is 
>> also not done.
>> 
>> Modified the code to honour the specification.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Test fix

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.

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

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

Reply via email to