Skip to content

Fix NullPointerExceptions in sibling lookup, restore and titlebar - #36

Merged
sylvestre merged 3 commits into
opencollab:masterfrom
danilovesky:fix-null-pointer-exceptions
Nov 21, 2026
Merged

sylvestre merged 3 commits into
opencollab:masterfrom
danilovesky:fix-null-pointer-exceptions

Conversation

@danilovesky

Copy link
Copy Markdown
Contributor

Fix NPE thrown instead of returning null or false:

  • DefaultDockingStrategy.findRegion() and both getSibling() overloads, for a dockable that is not docked
  • DockPathHandler and PointHandler, for a dockable without docking state, so restore now falls through to UnknownStateHandler; also PointHandler when there is no window to restore into
  • Titlebar(Action[]), and addAction() after an empty action array

Each fix comes with a headless JUnit test.

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.
@mergify

mergify Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@sylvestre
sylvestre merged commit 1d79760 into opencollab:master Nov 21, 2026
7 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

@danilovesky
danilovesky deleted the fix-null-pointer-exceptions branch November 22, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants