[concurrency-interest] Swing translates InterruptedException to Error

Darius Polonis duplon at majorgames.de
Sat Dec 15 08:40:02 EST 2007


Allright, in that case I'll just wrap my code and use  
SwingUtilities.invokeLater(). But I am not sure the Swing folks have  
to come to your conclusion, too, as the javadoc still states  
AbstractDocument.insertString() would be thread safe...

Anyway, thank you for your fast response.

Best wishes,

Darius


Am 15.12.2007 um 03:26 schrieb Joe Bowbeer:

> See:
>
> http://altair.cs.oswego.edu/mailman/private/concurrency-interest/ 
> 2003-June/000456.html
>
> In short: This code was originally even more broken, simply ignoring
> interrupts. The IE is later transcoded to preserve method signatures.
>
> In my opinion, it is not safe to modify documents asynchronously (that
> is, on threads other than the EDT).  I think the Swing folks have
> eventually come to this conclusion, too.
>
> Given that this is broken, what's the advantage in throwing a
> different kind of error?
>
> --Joe
>
> On Dec 14, 2007 6:39 PM, Darius Polonis <duplon at majorgames.de> wrote:
>> Hello there,
>>
>> basically I have the same question as Tom Cargill in June 06, 2003
>> (http://altair.cs.oswego.edu/mailman/private/concurrency-interest/
>> 2003-June/000454.html). I am inserting strings from different threads
>> and if such a thread is cancelled at the right time, the
>> InterruptedException will be translated into this Error.
>>
>> It looks like it may be safely ignored, doesn't it? If it may be
>> ignored, would it be possible to change the Error into a specific
>> Error, so that catching code doesn't have to catch all Errors and
>> make a decision based on the message string, but rather may catch the
>> InterruptedException for example by themselfes?
>>
>> Best wishes,
>>
>> Darius
>>
>



More information about the Concurrency-interest mailing list