Skip to content

SwingTerminal.dispose() should not be public API #1805

@gnodet

Description

@gnodet

SwingTerminal.dispose() is currently public, but it should not be part of the public API. Users should use Terminal.close() instead, which properly handles all cleanup.

Having dispose() public leads to confusion and potential double-close patterns (e.g., calling both dispose() and close()), as seen in SwingTerminalEncodingTest.

Proposed action:

  • Deprecate dispose() in the next minor release
  • Make it package-private or remove it in the next major release
  • Ensure close() delegates to dispose() internally so behavior is preserved

Found during review of #1794.

Claude Code on behalf of Guillaume Nodet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions