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

Prasanta Sadhukhan psadhukhan at openjdk.org
Thu Feb 2 04:19:24 UTC 2023


On Tue, 31 Jan 2023 15:34:44 GMT, Prasanta Sadhukhan <psadhukhan at 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 update

Implementation of `done` method is not changed to cause/invoke `CancellationException `.
 As per [JDK-6608234](https://bugs.openjdk.org/browse/JDK-6608234) "CancellationException" will be called for `get` method if `cancel `is invoked, which is still valid/working and as mentioned, we have not seen any exception either in jtreg or in jck with updated fix.

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

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



More information about the client-libs-dev mailing list