Skip to content

Fixed a Warning dialog appearing on NetBeans exit when a diff tab had been opened during the session - #144

Merged
oleg68 merged 3 commits into
nbplugins:mainfrom
oleg68:bugfix/fix-diff-tc-persistence
May 26, 2026
Merged

oleg68 merged 3 commits into
nbplugins:mainfrom
oleg68:bugfix/fix-diff-tc-persistence

Conversation

@oleg68

@oleg68 oleg68 commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Extracted the anonymous TopComponent subclass in FileDiffOpener.open() (was FileDiffOpener$1) into a named static nested class DiffTopComponent that overrides getPersistenceType() → PERSISTENCE_NEVER, preventing NetBeans from serializing it at shutdown
  • Added V1MigrationHelper.removeStaleComponentSettings() and called it from ClaudeCodeInstaller.restored() to delete any stale .settings files referencing FileDiffOpener$1 before the window system reads them — eliminates the warning for users upgrading from older versions
  • Added unit test FileDiffOpenerTest.diffTopComponentPersistenceTypeIsNever()

Test plan

  • Install 1.2.14-SNAPSHOT NBM
  • Open a Claude Code session and trigger a file edit so a diff tab opens
  • Close NetBeans — Warning dialog must not appear
  • Restart NetBeans — no Warning dialog on startup either

🤖 Generated with Claude Code

Oleg Samarin and others added 3 commits May 25, 2026 20:06
… been opened during the session

The anonymous TopComponent subclass created in FileDiffOpener.open() inherited
PERSISTENCE_ALWAYS from TopComponent, causing NetBeans to attempt serialization at
shutdown. Extracted it to a named static nested class DiffTopComponent that overrides
getPersistenceType() to return PERSISTENCE_NEVER.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Added V1MigrationHelper.removeStaleComponentSettings() and called it from
ClaudeCodeInstaller.restored() to delete any .settings files referencing
FileDiffOpener\$1 before the NetBeans window system reads them. This prevents
the Warning dialog that appeared on startup when upgrading from 1.2.11
(where FileDiffOpener\$1 was serialized) to 1.2.13+ (where it is gone).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleg68
oleg68 merged commit b9a1f6b into nbplugins:main May 26, 2026
3 checks passed
@oleg68
oleg68 deleted the bugfix/fix-diff-tc-persistence branch May 26, 2026 06:59
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