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

Add ULong list support for fixed32-like repeated fields #417

Merged
merged 12 commits into from
Jul 17, 2023

Conversation

buildbreaker
Copy link
Contributor

@buildbreaker buildbreaker commented Jun 30, 2023

What I observed was that a fixed32 gets interpreted as an int rather than a long during evaluation.

There are various parts of FileDescription that swapped between considering fixed32s as an integer or a long. The change here is to also make things more consistent within each other.

Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

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

Generally LGTM - but need to take a closer look.

@buildbreaker
Copy link
Contributor Author

@snazy Thank you!

}

@Test
public void uintInList() throws ScriptException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Positive test

}

@Test
public void uintNotInList() throws ScriptException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Negative test

@buildbreaker
Copy link
Contributor Author

@snazy Sorry, the tests are failing. I'll fix them before I ping you for another review.

@buildbreaker buildbreaker marked this pull request as draft July 5, 2023 21:34
@buildbreaker buildbreaker marked this pull request as ready for review July 5, 2023 22:50
@buildbreaker buildbreaker requested a review from snazy July 5, 2023 22:50
@buildbreaker
Copy link
Contributor Author

buildbreaker commented Jul 5, 2023

Ok. I believe this is good from my fork's branch

Let me know if you would like me to move any files around (namely: the test) @snazy . Thank you for your help here!

return Integer.class;
case INT64:
case SFIXED64:
case SINT64:
return Long.class;
case UINT32:
case UINT64:
case FIXED32:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change is to make reading fixed32 consistent. The other parts of the file considers fixed32s as a ULong/Uint (e.g. here)

@buildbreaker
Copy link
Contributor Author

Hey @snazy this is ready for you to take another look when you're available :)

Happy to chat if you have any questions!

Copy link
Member

@snazy snazy left a comment

Choose a reason for hiding this comment

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

Thanks for the change - it looks reasonable and good!
Just one comment about an if that seems superfluous.

@buildbreaker
Copy link
Contributor Author

@snazy Thanks for the review. I removed the redundant check that you called out!

@snazy snazy merged commit 6eb9b65 into projectnessie:main Jul 17, 2023
4 checks passed
@buildbreaker buildbreaker deleted the ac/fix-list-in branch July 17, 2023 16:25
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