JDK-8199324 : IllegalStateException: Not a permutation change in TreeTableView when selection is active
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • Submitted: 2018-03-08
  • Updated: 2020-06-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
Execute the attached TreeTableView program. 
"java.lang.IllegalStateException: Not a permutation change" exception is thrown. This happens only when selection is active. Also note that no exception is thrown in case of TreeView.

Comments
technically, the reason is an incorrect wasPermutated calculation in TreeModificationEvent: this.wasPermutated = added != null && removed != null && added.size() == removed.size() && added.containsAll(removed); that incorrectly sets the permutated flag for replacing a list with itself. Probably should query the change itself. But then, the whole event mapping needs a thorough overhaul as it routes disjoint changes from the real notification as a single one (pretty sure that we have bugs around that here, just can't remember - found one at least: JDK-8090563) The reason the error shows up in TreeTableView's selectionModel but not in TreeView's selectionModel is that the listener in the former handles the permutated case while the latter doesn't.
09-03-2018

Stack Trace: Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException: Not a permutation change at javafx.base/javafx.collections.ListChangeListener$Change.getPermutation(ListChangeListener.java:292) at javafx.controls/javafx.scene.control.TreeTableView$TreeTableViewArrayListSelectionModel$3.handle(TreeTableView.java:2552) at javafx.controls/javafx.scene.control.TreeTableView$TreeTableViewArrayListSelectionModel$3.handle(TreeTableView.java:2440) at javafx.base/javafx.event.WeakEventHandler.handle(WeakEventHandler.java:79) at javafx.base/com.sun.javafx.event.CompositeEventHandler$WeakEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:248) at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.base/javafx.event.Event.fireEvent(Event.java:198) at javafx.controls/javafx.scene.control.TreeItem.fireEvent(TreeItem.java:763) at javafx.controls/javafx.scene.control.TreeItem.updateChildren(TreeItem.java:942) at javafx.controls/javafx.scene.control.TreeItem.lambda$new$0(TreeItem.java:424) at javafx.base/com.sun.javafx.collections.ListListenerHelper$SingleChange.fireValueChangedEvent(ListListenerHelper.java:164) at javafx.base/com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73) at javafx.base/javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233) at javafx.base/javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482) at javafx.base/javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541) at javafx.base/javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205) at javafx.base/javafx.collections.ModifiableObservableListBase.setAll(ModifiableObservableListBase.java:90) at javafx.base/javafx.collections.ObservableListBase.setAll(ObservableListBase.java:251) at TreeTableViewTest.start(TreeTableViewTest.java:46) at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:172) at java.base/java.lang.Thread.run(Thread.java:844)
08-03-2018