<Swing Dev>  RFR JDK-8190763:Class cast exception on (CompoundEdit) UndoableEditEvent.getEdit()
prasanta.sadhukhan at oracle.com
Thu Dec 14 10:16:24 UTC 2017
Please review a fix for a regression introduced inJDK-8030702:
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
With this, no CCE is seen and the 8030702
<https://bugs.openjdk.java.net/browse/JDK-8030702> also passed.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swing-dev