Set an explicit Spinner maximum in addSpinnerButton#58
Merged
Conversation
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
There was a problem hiding this comment.
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 above100. - Set the
Spinnermaximum toInteger.MAX_VALUE(before setting the minimum) to prevent range collapse whenminimum > 100.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Follow-up to #57, addressing this review comment.
SWT
Spinnerdefaults to a maximum of100.addSpinnerButtononly set a minimum, so any stored or default value above100was silently clamped, and aminimumabove100could 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