bug/issue 49: Fix findings described in ussue-49 - #50
Open
philliplbryant wants to merge 4 commits into
Open
philliplbryant wants to merge 4 commits into
philliplbryant wants to merge 4 commits into
Conversation
* Replaced reference-equality comparisons with `.equals()`/`Objects.equals()`. * Simplified the redundant `instanceof` check to a null check. * Guarded `@Nullable` field dereferences. * Extracted `DragUtils`'s `dragBoard` splitting into a shared helper function that uses a negative split limit, so an empty trailing field (e.g. an empty dockable identifier with no drop target) is no longer silently dropped. * Added unit test coverage for `DragUtils`'s shared helper function. * Remove disallowed self-closing `<p/>` tags.
* Fix an additional nullability issue.
* update Javadoc configurations remaining from a separate issue.
* Run JavaFX tests headless with Monocle so they pass on CI runners without a display.
Col-E
reviewed
Sep 18, 2026
Comment on lines
-152
to
+154
| if (leaf.getParentContainer() != root && leaf.getParentContainer() != null) | ||
| if (!Objects.equals(leaf.getParentContainer(), root) && | ||
| leaf.getParentContainer() != null) |
Owner
There was a problem hiding this comment.
A lot of these identity checks were intentional and should be kept, not converted to equals.
The check here and in many other cases is essentially "Is my parent the root?" - An identity check is much faster and will always yield the correct results in the current model. There is no scenario where an equality check would positively impact correctness. Equality checking is also much slower depending on the equals implementation (And if the impl checks children and they check theirs, potentially horrendous performance)
Owner
There was a problem hiding this comment.
Since a lot of the changes boil down to the same thing I won't comment on each case this happens for.
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.
.equals()/Objects.equals().instanceofcheck to a null check.@Nullablefield dereferences.DragUtils'sdragBoardsplitting into a shared helper function that uses a negative split limit, so an empty trailing field (e.g. an empty dockable identifier with no drop target) is no longer silently dropped.DragUtils's shared helper function.DockContainerLeaf's null parent issue.<p/>tags.coreand to run JavaFX tests headless without a displayOf the findings, only the
DragUtilssplitting behavior andDockContainerLeaf's null parent issue were testable. None of the compared types in the other findings overrideequals(), so those fixes are preventative.toggleCollapsenow returns the unchanges state instead of throwing NPE.When drag drop content ends in an empty identifier, extract identifier now returns an empty dockable identifier string instead of null.
Similarly, guards for
@Nullablefield dereferences are preventative with no observable changes in behavior. Other changes have no observable changes in behavior.