Skip to content
This repository was archived by the owner on Sep 19, 2021. It is now read-only.

Fixing Uuid Parse Error#66

Merged
vaage merged 1 commit intomasterfrom
fix-uuid-from-string
Apr 24, 2017
Merged

Fixing Uuid Parse Error#66
vaage merged 1 commit intomasterfrom
fix-uuid-from-string

Conversation

@vaage
Copy link
Copy Markdown
Contributor

@vaage vaage commented Apr 20, 2017

In Uuid, ids are 32 bit unsigned integers. As Java does not supported
unsigned integers, when converting to a string, the 32 bit integer is
converted to a long so that it can be written to a string as a
positive integer (using all 32 bits).

When converting from a string to a Uuid, the integer value is not
handled correctly as values that would be acceptable as a 32 bit
unsigned integer fail to be parsed as a 32 bit signed integer.

If the id value of a Uuid is 0xFFFFFFFF and is converted to the string
4294967295. When 4294967295 is parsed, it will fail as it is not
expressible as a 32 bit signed integer.

Parsing needs to parse the unsigned integer and convert and store the
bit pattern correctly in a signed integer.

Closes #62

In Uuid, ids are 32 bit unsigned integers. As Java does not supported
unsigned integers, when converting to a string, the 32 bit integer is
converted to a long so that it can be written to a string as a
positive integer (using all 32 bits).

When converting from a string to a Uuid, the integer value is not
handled correctly as values that would be acceptable as a 32 bit
unsigned integer fail to be parsed as a 32 bit signed integer.

If the id value of a Uuid is 0xFFFFFFFF and is converted to the string
4294967295. When 4294967295 is parsed, it will fail as it is not
expressible as a 32 bit signed integer.

Parsing needs to parse the unsigned integer and convert and store the
bit pattern correctly in a signed integer.

Closes #62
@vaage vaage added the bug label Apr 20, 2017
@vaage vaage self-assigned this Apr 20, 2017
@vaage vaage requested review from crepricg and wgenemorgan April 20, 2017 00:10
@vaage vaage merged commit 98e7d23 into master Apr 24, 2017
vaage added a commit that referenced this pull request Apr 26, 2017
* Made Secret into a full class
* Simplifying Secret Parse
* Relay re-load teams file
* Adding missing final statements
* Correcting confusing comment
* Moved Random Uuid Generator
* Fixing Uuid Parse Error (#66)
@vaage vaage deleted the fix-uuid-from-string branch April 26, 2017 16:45
vaage added a commit that referenced this pull request May 9, 2017
* Made Secret into a full class
* Simplifying Secret Parse
* Relay re-load teams file
* Adding missing final statements
* Correcting confusing comment
* Moved Random Uuid Generator
* Fixing Uuid Parse Error (#66)
evansenter added a commit to Vekktone/codeu_project_2017 that referenced this pull request Jun 1, 2017
* upstream/master:
  Corrected Variable Expansion To Meet Style Guide Requirements (google#86)
  Fixing Uuid Parse Error (google#66)
  Moved Random Uuid Generator
  Fixed Message Response Failed
  Correcting confusing comment
  Adding missing final statements
  Relay re-load teams file
  Fix Blank Line Fail in Teams File
  Update README to explain <persistent-dir>
  Improved messaging of variables in run_server.sh
  Fixes HEX conversion for secret.
  Replaces 'or' with 'and'.
  Adding specification for the secret server to be an hex string.
  README update with new cmdline arguments
  Adding a path for persistent data
  Changing How The Relay Processes Reads
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants