eirikbakke commented on PR #7668:
URL: https://github.com/apache/netbeans/pull/7668#issuecomment-2313949749

   @matthiasblaesing It's quite possible (likely, even) that 
https://github.com/apache/netbeans/issues/3962 has race conditions involved. 
Someone would have to spend a week(end) finding the root cause of it before we 
could figure the best way to solve it, though. For me it was never worth it, 
because the previous patches, or just other environmental conditions, made the 
problem rare and easy to work around.
   
   Though often I find that fixing smaller understandable bugs, like the 
blocking removeFlavorListener() here, sometimes magically ends up fixing bigger 
hard-to-reproduce bugs.
   
   For the systemClipboard.addFlavorListener()/removeFlavorListener() calls it 
is (somewhat) easy to reason about concurrency behavior by reading the source 
code of java.awt.datatransfer.Clipboard class. For getContents/setContents 
things go much deeper, as you mention.
   
   Since I have now switched permanently from Windows to MacOS on my working 
machine, it is hard for me to properly test further changes to this PR, as 
these clipboard bugs usually come only after several days of active use. If 
preferred, I could drop the controversial "Avoid calling 
Clipboard.add/removeFlavorListener from the Event Dispatch Thread" commit and 
leave the two others.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to