<Swing Dev> [11] RFR JDK-8190763:Class cast exception on (CompoundEdit) UndoableEditEvent.getEdit()

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Thu Dec 14 10:16:24 UTC 2017


Hi All,

Please review a fix for a regression introduced inJDK-8030702: 
<https://bugs.openjdk.java.net/browse/JDK-8030702>Deadlock between 
subclass of AbstractDocument and UndoManager
where UndoableEditEvent.getEdit() was made to return 
DefaultDocumentEventUndoableWrapper (or UndoableEdit, an interface) 
instead of CompoundEdit (a concrete class)
so when application wants to cast to CompoundEdit, it results in CCE.
Also, it seems the application expects DefaultDocumentEvent instance 
also via UndoableEditEvent.getEdit() so that it can utilise it to get 
offset and length of editable change.

Proposed fix is to make DefaultDocumentEvent implement 
UndoableEditLockSupport (used to prevent deadlock in 8030702 
<https://bugs.openjdk.java.net/browse/JDK-8030702>).
With this, no CCE is seen and the 8030702 
<https://bugs.openjdk.java.net/browse/JDK-8030702> also passed.
http://cr.openjdk.java.net/~psadhukhan/8190763/webrev.00/

Regards
Prasanta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20171214/6cf20541/attachment.html>


More information about the swing-dev mailing list