-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix ClassCastException during drag-and-drop caused by transient tab state #13244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Subhramit Basu <[email protected]>
|
This is a JavaFX issue. @Siedlerchr how to report? Update: Moved to #12921 (comment) as it concerns more the original issue than this work around |
koppor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code nees to be adapted, since the FilteredList is not right at all due to a JavaFX bug.
| return null; | ||
| } | ||
| }); | ||
| EasyBind.bindContent(stateManager.getOpenDatabases(), new FilteredList<>(openDatabaseList, Objects::nonNull)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, the list will be wrong on tab change. Maybe some custom code needs to be placed here? IDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a specific case you had in mind ? i manually tested tab changes (opening, closing, rearranging) and openDatabaseList seems to accurately reflect the tab state.
|
you can file a bug report https://bugreport.java.com/bugreport/ |
Submitted a JavaFX error report - internal review ID : 9078592 |
exception no longer occurs with no FilteredList usage, with the lists accurately reflecting the state of the tabs. i added some listener code to filter out the nulls from the mapping and keep it in sync with |
koppor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some code simplificatoin comments.
Co-authored-by: Oliver Kopp <[email protected]>
Co-authored-by: Oliver Kopp <[email protected]>
Co-authored-by: Oliver Kopp <[email protected]>
Co-authored-by: Oliver Kopp <[email protected]>
Co-authored-by: Oliver Kopp <[email protected]>
|
@trag-bot didn't find any issues in the code! ✅✨ |
Closes #12921
the type-check predicate can behave inconsistently during the interaction, likely a timing/synchronization issue caused by how the UI updates the tab list during drag-and-drop while the filtered list is reacting to changes.
directly mapping over the original tabs list with a lambda that accoutns for possible non-
LibraryTabentries solves the issue. this results inopenDatabaseListpossibly holding null values but since it is a private member not accessed elsewhere and we bind a filtered version toStateManager::openDatabases, it should not cause any further bugs.a more robust solution could be implemented with listeners, but it might be overkill ?
Steps to test
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if change is visible to the user)