Skip to content

Fixed a "Warning" dialog with raw XML content sometimes appearing at IDE startup after using a diff view - #161

Merged
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/diff-topcomponent-settings-corruption
Jul 14, 2026
Merged

Fixed a "Warning" dialog with raw XML content sometimes appearing at IDE startup after using a diff view#161
oleg68 merged 1 commit into
nbplugins:mainfrom
oleg68:bugfix/diff-topcomponent-settings-corruption

Conversation

@oleg68

@oleg68 oleg68 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The diff-viewer's anonymous TopComponent in OpenDiff.java didn't override getPersistenceType(), defaulting to PERSISTENCE_ALWAYS
  • NetBeans then tried to persist this ephemeral tab (and non-serializable async-handler state its listeners closed over) into a .settings file on exit, which failed to deserialize on next startup and surfaced as a "Warning" dialog dumping raw XML
  • Extracted the anonymous class into a named OpenDiff.DiffTopComponent overriding getPersistenceType() to PERSISTENCE_NEVER, matching the existing correct pattern in FileDiffOpener.DiffTopComponent

Test plan

  • Added OpenDiffTest.diffTopComponentPersistenceTypeIsNever asserting the persistence type
  • mvn test — full suite passes
  • mvn package — builds successfully
  • Manually verified: after installing the fixed build and cleaning up pre-existing corrupted .settings/.wstcref entries from before the fix, the warning dialog no longer appears at startup

🤖 Generated with Claude Code

…IDE startup after using a diff view

OpenDiff.java's diff-viewer TopComponent didn't override getPersistenceType(),
so it defaulted to PERSISTENCE_ALWAYS. NetBeans would then try to persist this
ephemeral tab (and the non-serializable async-handler state its toolbar
listeners closed over) to a .settings file on IDE exit, which failed to
deserialize on the next startup and surfaced as a raw-XML warning dialog.

Extracted the anonymous TopComponent into a named OpenDiff.DiffTopComponent
that overrides getPersistenceType() to PERSISTENCE_NEVER, matching the
existing correct pattern in FileDiffOpener.DiffTopComponent.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@oleg68
oleg68 merged commit 3afeb61 into nbplugins:main Jul 14, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/diff-topcomponent-settings-corruption branch July 14, 2026 08:33
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.

1 participant