-
Notifications
You must be signed in to change notification settings - Fork 19
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
Conversation
There was a problem hiding this 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.
@snazy Thank you! |
} | ||
|
||
@Test | ||
public void uintInList() throws ScriptException { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Negative test
@snazy Sorry, the tests are failing. I'll fix them before I ping you for another review. |
return Integer.class; | ||
case INT64: | ||
case SFIXED64: | ||
case SINT64: | ||
return Long.class; | ||
case UINT32: | ||
case UINT64: | ||
case FIXED32: |
There was a problem hiding this comment.
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)
Hey @snazy this is ready for you to take another look when you're available :) Happy to chat if you have any questions! |
There was a problem hiding this 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.
core/src/main/java/org/projectnessie/cel/interpreter/AttributeFactory.java
Outdated
Show resolved
Hide resolved
@snazy Thanks for the review. I removed the redundant check that you called out! |
What I observed was that a fixed32 gets interpreted as an
int
rather than along
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.