DockHeirarchyLock exception

I am running df 1.1.1, JDK 17.0 (latest release) on Linux.

I have some dockables in a StackDockStation, which in turn is in a CGridArea. When I cycle the CGridArea from normal to external to normal to external I get the DockHeirarchyLock error. I confirmed that all access to the DockingFrames Heirarchy is through the AWT Event Thread.

The end result is that the CGridArea seems to lose it’s stack dock station child.

java.lang.IllegalStateException: During an operation the framework attempted to acquire the same lock twice. There are two possible explanations:

  1. In a multi-threaded application one or both operations are not executed in the EventDispatchThread, or
  2. The operations are calling each other, which should not happen.
    Please verify that this application is not accessing the framework from different threads, and fill a bugreport if you feel that this exception is not caused by your application.
    at bibliothek.gui.dock.DockHierarchyLock.acquireUnlink(DockHierarchyLock.java:314)
    at bibliothek.gui.dock.DockHierarchyLock.acquireUnlinking(DockHierarchyLock.java:226)
    at bibliothek.gui.dock.SplitDockStation.removeDisplayer(SplitDockStation.java:2716)
    at bibliothek.gui.dock.SplitDockStation.removeAllDockables(SplitDockStation.java:2595)
    at bibliothek.gui.dock.SplitDockStation.dropTree(SplitDockStation.java:2197)
    at bibliothek.gui.dock.SplitDockStation.dropTree(SplitDockStation.java:2171)
    at bibliothek.gui.dock.station.split.SplitPlaceholderConverter.dropTree(SplitPlaceholderConverter.java:66)
    at bibliothek.gui.dock.station.split.SplitPlaceholderConverter.dropTree(SplitPlaceholderConverter.java:40)
    at bibliothek.gui.dock.station.split.AbstractSplitPlaceholderConverter.setPlaceholders(AbstractSplitPlaceholderConverter.java:95)
    at bibliothek.gui.dock.SplitDockStation.setPlaceholders(SplitDockStation.java:1526)
    at bibliothek.gui.dock.station.support.DockablePlaceholderList.setPlaceholders(DockablePlaceholderList.java:121)
    at bibliothek.gui.dock.station.support.DockablePlaceholderList.setPlaceholders(DockablePlaceholderList.java:37)
    at bibliothek.gui.dock.station.support.PlaceholderList.put(PlaceholderList.java:671)
    at bibliothek.gui.dock.ScreenDockStation.register(ScreenDockStation.java:1775)
    at bibliothek.gui.dock.ScreenDockStation.addDockable(ScreenDockStation.java:1278)
    at bibliothek.gui.dock.ScreenDockStation.executeDrop(ScreenDockStation.java:1493)
    at bibliothek.gui.dock.ScreenDockStation.drop(ScreenDockStation.java:1369)
    at bibliothek.gui.dock.ScreenDockStation.drop(ScreenDockStation.java:1335)
    at bibliothek.gui.dock.ScreenDockStation.drop(ScreenDockStation.java:1319)
    at bibliothek.gui.dock.common.mode.station.CScreenDockStationHandle$External.setLocation(CScreenDockStationHandle.java:213)
    at bibliothek.gui.dock.facile.mode.ExternalizedMode.externalize(ExternalizedMode.java:130)
    at bibliothek.gui.dock.facile.mode.ExternalizedMode.runApply(ExternalizedMode.java:97)
    at bibliothek.gui.dock.facile.mode.AbstractLocationMode.apply(AbstractLocationMode.java:368)
    at bibliothek.gui.dock.facile.mode.AbstractLocationMode.apply(AbstractLocationMode.java:52)
    at bibliothek.gui.dock.support.mode.ModeManager$4.run(ModeManager.java:698)
    at bibliothek.gui.dock.support.mode.ModeManager.runTransaction(ModeManager.java:512)
    at bibliothek.gui.dock.support.mode.ModeManager.runTransaction(ModeManager.java:491)
    at bibliothek.gui.dock.support.mode.ModeManager.apply(ModeManager.java:692)
    at bibliothek.gui.dock.support.mode.ModeManager.apply(ModeManager.java:623)
    at bibliothek.gui.dock.support.mode.ModeManager.apply(ModeManager.java:559)
    at bibliothek.gui.dock.support.mode.ModeManager.apply(ModeManager.java:539)
    at bibliothek.gui.dock.facile.mode.LocationModeManager$6$1.setMode(LocationModeManager.java:293)
    at bibliothek.gui.dock.common.group.SingleGroupMovement.apply(SingleGroupMovement.java:52)
    at bibliothek.gui.dock.facile.mode.LocationModeManager$6.run(LocationModeManager.java:291)
    at bibliothek.gui.dock.support.mode.ModeManager$3.run(ModeManager.java:474)
    at bibliothek.gui.dock.support.mode.ModeManager.runTransaction(ModeManager.java:512)
    at bibliothek.gui.dock.support.mode.ModeManager.runTransaction(ModeManager.java:472)
    at bibliothek.gui.dock.support.mode.ModeManager.runTransaction(ModeManager.java:453)
    at bibliothek.gui.dock.facile.mode.LocationModeManager.apply(LocationModeManager.java:286)
    at bibliothek.gui.dock.facile.mode.LocationModeManager$5.run(LocationModeManager.java:262)
    at bibliothek.gui.dock.support.mode.ModeManager.runTransaction(ModeManager.java:512)
    at bibliothek.gui.dock.support.mode.ModeManager.runTransaction(ModeManager.java:491)
    at bibliothek.gui.dock.facile.mode.LocationModeManager.setMode(LocationModeManager.java:255)
    at bibliothek.gui.dock.common.intern.AbstractCDockable.setExtendedMode(AbstractCDockable.java:395)
    at bibliothek.gui.dock.common.intern.action.CExtendedModeAction.action(CExtendedModeAction.java:189)
    at bibliothek.gui.dock.common.intern.action.CExtendedModeAction$Action.action(CExtendedModeAction.java:227)
    at bibliothek.gui.dock.themes.basic.action.BasicButtonHandler.triggered(BasicButtonHandler.java:48)
    at bibliothek.gui.dock.themes.basic.action.BasicButtonModel.trigger(BasicButtonModel.java:704)
    at bibliothek.gui.dock.themes.basic.action.BasicButtonModel$Listener.mouseReleased(BasicButtonModel.java:742)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
    at java.awt.Component.processMouseEvent(Component.java:6505)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:682)
    at java.awt.EventQueue$3.run(EventQueue.java:680)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:696)
    at java.awt.EventQueue$4.run(EventQueue.java:694)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

Thanks.

OH, and this is with the default theme.

It DOES NOT seem to happen with the Eclipse theme.

Will have a look at it.

Quite a nasty bug, but it will be fixed in the next release (I’ll upload the release until the next weekend, but it will be available from the git repository much earlier).

What happened? When making the CGridArea floating (externalized), the new parent, a ScreenDockStation, did remember the layout of the CGridArea. It tried to force the old layout onto the grid-area. But the grid-area already has children, and it does not like having a new layout forced onto it if there are children… the fix is now to ignore the existence of the old layout: it would be wrong applying it anyway, because the grid-area can take care of its children very well.