Repository navigation
Fix NullPointerExceptions in sibling lookup, restore and titlebar - #36
Merged
sylvestre merged 3 commits intoNov 21, 2026
Merged
Conversation
DefaultDockingStrategy.findRegion dereferenced the docking port, which is null for a dockable that is not docked. As a result both getSibling overloads threw NullPointerException instead of returning null, as their javadoc promises.
DockPathHandler and PointHandler dereferenced the docking state, which is null for a dockable that is not registered under its persistent id. They threw NullPointerException instead of declining, so UnknownStateHandler was never tried, unlike after the other handlers. PointHandler also threw when there was no window to restore into, as before any docking window exists.
Titlebar.setActions created actionList and actionButtons only for a null argument. With one or more actions addAction threw NullPointerException, and after an empty array any later addAction did.
|
This pull request is merged. |
Contributor
|
Thanks for your PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix NPE thrown instead of returning null or false:
DefaultDockingStrategy.findRegion()and bothgetSibling()overloads, for a dockable that is not dockedDockPathHandlerandPointHandler, for a dockable without docking state, so restore now falls through toUnknownStateHandler; alsoPointHandlerwhen there is no window to restore intoTitlebar(Action[]), andaddAction()after an empty action arrayEach fix comes with a headless JUnit test.