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

Why bitField offset argument is converted to int? #2974

Open
psw0946 opened this issue Aug 20, 2024 · 0 comments
Open

Why bitField offset argument is converted to int? #2974

psw0946 opened this issue Aug 20, 2024 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@psw0946
Copy link

psw0946 commented Aug 20, 2024

I have an issue when I try to do bitfield with set subcommands.
But, when I pass offset argument with a long value, it emits an error with message,

Offset must be greater or equal to 0
java.lang.IllegalArgumentException: Offset must be greater or equal to 0
...

When I pass integer value offset, it succeeds.

It seems that it converts the offset value from long to int type in LettuceConverters.java.

BitFieldArgs.Offset offset = subCommand.getOffset().isZeroBased()
    ? BitFieldArgs.offset((int) subCommand.getOffset().getValue())
    : BitFieldArgs.typeWidthBasedOffset((int) subCommand.getOffset().getValue());

I think that it is caused by the lettuce core, because its offset type is int. But confusingly,, it is declared as long type at some places in lettuce core. So, I also submitted a issue on the lettuce github (link).

Is there any reason to declare offset as type int?
I can pass a long value offset with redis-cli.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants