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

Task: Fix nullable operator comparison on Atomic types #126

Open
NightOwl888 opened this issue Dec 14, 2024 · 0 comments
Open

Task: Fix nullable operator comparison on Atomic types #126

NightOwl888 opened this issue Dec 14, 2024 · 0 comments
Labels
good first issue Good for newcomers pri:normal up for grabs This issue is open to be worked on by anyone
Milestone

Comments

@NightOwl888
Copy link
Owner

NightOwl888 commented Dec 14, 2024

The current operator comparison logic on Atomic types is broken in 3 ways:

  1. We aren't declaring the atomic (reference) types as nullable.
  2. We are using GetValueOrDefault() on nullable value types to do the comparison rather than properly checking for null input. We should only return true if both sides are null if either of them are. But, we are normalizing null to be the same as 0, which is not correct.
  3. Atomic (reference) types are not being checked for null, so they could throw an NRE. We need to add null checking.

See: apache/lucenenet#1064

@NightOwl888 NightOwl888 added good first issue Good for newcomers pri:normal up for grabs This issue is open to be worked on by anyone labels Dec 14, 2024
@NightOwl888 NightOwl888 added this to the 2.2 milestone Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers pri:normal up for grabs This issue is open to be worked on by anyone
Projects
None yet
Development

No branches or pull requests

1 participant