Skip to content

Set an explicit Spinner maximum in addSpinnerButton#58

Merged
khatchad merged 1 commit into
masterfrom
spinner-explicit-maximum
Jun 22, 2026
Merged

Set an explicit Spinner maximum in addSpinnerButton#58
khatchad merged 1 commit into
masterfrom
spinner-explicit-maximum

Conversation

@khatchad

Copy link
Copy Markdown
Member

Follow-up to #57, addressing this review comment.

SWT Spinner defaults to a maximum of 100. addSpinnerButton only set a minimum, so any stored or default value above 100 was silently clamped, and a minimum above 100 could collapse the allowed range unexpectedly.

This raises the maximum to Integer.MAX_VALUE (set before the minimum so neither bound clamps the value), keeping the contract that only a minimum is pinned—the fields this serves (k-CFA depth, etc.) have no natural upper bound. The Javadoc now documents the unbounded maximum.

🤖 Generated with Claude Code

SWT Spinner defaults to a maximum of 100. addSpinnerButton only set a
minimum, so any stored or default value above 100 was silently clamped,
and a minimum above 100 could collapse the allowed range. Raise the
maximum to Integer.MAX_VALUE (before setting the minimum) so neither
bound silently clamps the value, matching the method contract that only
a minimum is pinned.

Addresses review feedback on #57.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ydAvERPms47vaUevbsoFX
Copilot AI review requested due to automatic review settings June 22, 2026 14:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates InputPage.addSpinnerButton to avoid SWT Spinner’s default maximum of 100 clamping stored/default values, ensuring the control behaves correctly for integer settings that have a minimum but no practical upper bound.

Changes:

  • Documented in the Javadoc that the spinner maximum is effectively unbounded (Integer.MAX_VALUE) to avoid silent clamping above 100.
  • Set the Spinner maximum to Integer.MAX_VALUE (before setting the minimum) to prevent range collapse when minimum > 100.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@khatchad
khatchad merged commit 4972ef0 into master Jun 22, 2026
6 checks passed
@khatchad
khatchad deleted the spinner-explicit-maximum branch June 22, 2026 15:02
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