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

Warn when value is larger than bytes can hold #3

Open
thorstenfrank opened this issue May 27, 2018 · 0 comments
Open

Warn when value is larger than bytes can hold #3

thorstenfrank opened this issue May 27, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@thorstenfrank
Copy link
Owner

Currently it is possible to do this:

@BoundNumber(size = "16")
private int aNumber;
...
aNumber = Integer.MAX_VALUE;

which will result in an encoded value of 65535 because Preon doesn't validate the actual value.

There should be at least a warning (or even an exception) when trying to encode this.

@thorstenfrank thorstenfrank added the enhancement New feature or request label May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant