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

Parsing large longs instead of crashing on Long.parseLong("0xffffffff") #268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paulpv
Copy link
Contributor

@paulpv paulpv commented Aug 25, 2015

No description provided.

@davidgyoung
Copy link
Member

This offers a partial fix to this issue: #173

A problem with this solution is that it changes the behavior of the library for identifier fields that are 6 bytes long (e.g. Eddystone-UID instance identifier fields) which are supposed to be converted to a string as hex (e.g. "0x010203040506"). Because this behavior is published, this would essentially be a breaking API change.

An alternate solution to this would be to not use the string when converting to the long values for the data fields but instead using the underlying byte array.

@paulpv
Copy link
Contributor Author

paulpv commented Aug 28, 2015

@davidgyoung Understood.
Would it perhaps be worth adding a flag or parameter to interpret the number as hex or decimal?

@davidgyoung
Copy link
Member

The Identifier class stores as a byte array internally, and utility methods allow conversion to various formats. The default string conversion, however needs to remain consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants