Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for settings with 8 or 16 bit data types #1522

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

Mailaender
Copy link
Contributor

including a test case where a value between 1 and 100 is now stored as byte.

@eselmeister
Copy link
Contributor

@Mailaender Using short and byte as data types looks good. When changing

@IntSettingsProperty
private int numberOfTargets = PreferenceSupplier.DEF_NUMBER_OF_TARGETS;

to

@ByteSettingsProperty(minValue = PreferenceSupplier.MIN_NUMBER_OF_TARGETS, maxValue = PreferenceSupplier.MAX_NUMBER_OF_TARGETS)
private byte numberOfTargets = PreferenceSupplier.DEF_NUMBER_OF_TARGETS;

Can you ensure backward compatibility?
The setting is already used, so we don't want to break existing/used settings.

@Mailaender
Copy link
Contributor Author

Mailaender commented Oct 5, 2023

Internally, it is still saved as int because the Eclipse preferences framework does not support short. JSON only supports a generic number data type. This is more about validating min/max ranges properly when the Java data type is smaller.

@eselmeister eselmeister merged commit a4d9baf into eclipse:develop Oct 5, 2023
3 checks passed
@Mailaender Mailaender deleted the small-data-types branch October 5, 2023 08:13
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.

None yet

2 participants