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

CBOR: Improve recognition of CBOR data format and update to Jackson 2.4.3 #8637

Closed
wants to merge 1 commit into from

Conversation

pickypg
Copy link
Member

@pickypg pickypg commented Nov 24, 2014

  • Update pom to 2.4.3 from 2.4.2
  • Enable the CBOR data header (aka tag) from the CBOR Generator to provide binary identification like the Smile format
  • Check for the CBOR header and ensure that the data sent in represents a "major type" that is an object
  • Cleans up JsonVsCborTests unused imports

Closes #7640

@pickypg pickypg added the review label Nov 24, 2014
@pickypg
Copy link
Member Author

pickypg commented Nov 24, 2014

@s1monw I think you wanted this ASAP


for (int i = 0; i < length; i++) {
for (int i = 1; i < length; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for other reviewers wondering where this change comes from, the first char is already checked earlier in this method

@jpountz
Copy link
Contributor

jpountz commented Nov 24, 2014

Just left one question/comment about the detection of short json documents, otherwise it looks good!

}
if (first == (CBORConstants.BYTE_OBJECT_INDEFINITE & 0xff)){

if (isCBORObjectHeader((byte)first, (byte)second, (byte)third, (byte)fourth)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you should also check that third and fourth are different from -1, otherwise this indicator of a missing byte (-1) is going to be converted to a legal byte (255) via the cast?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Adjusted so that it also includes the loop as well.

@jpountz
Copy link
Contributor

jpountz commented Nov 25, 2014

@pickypg Just left a minor comment, I think it's close

@jpountz
Copy link
Contributor

jpountz commented Nov 25, 2014

LGTM

- Update pom to 2.4.3 from 2.4.2
- Enable the CBOR data header (aka tag) from the CBOR Generator to provide binary identification like the Smile format
- Check for the CBOR header and ensure that the data sent in represents a "major type" that is an object
- Cleans up `JsonVsCborTests` unused imports
@pickypg pickypg closed this Nov 25, 2014
@pickypg pickypg deleted the feature/recognize-cbor-7640 branch November 25, 2014 19:04
@pickypg
Copy link
Member Author

pickypg commented Nov 25, 2014

Merged 7523d0b (forgot to change message to Closes ...)

@clintongormley clintongormley changed the title Update to Jackson 2.4.3 Internal: Update to Jackson 2.4.3 Nov 25, 2014
@clintongormley clintongormley changed the title Internal: Update to Jackson 2.4.3 CBOR: Improve recognition of CBOR data format and update to Jackson 2.4.3 Nov 25, 2014
@clintongormley
Copy link
Contributor

PR reverted for now

@s1monw
Copy link
Contributor

s1monw commented Dec 1, 2014

@pickypg any news on this?

@pickypg
Copy link
Member Author

pickypg commented Dec 2, 2014

@s1monw Nothing substantial. It looks like I'll have time today to dive deeper.

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

Successfully merging this pull request may close these issues.

CBOR: Improve recognition of CBOR data format
4 participants