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

SolrDedupServiceImpl: potential bug found in method cleanIndex #462

Open
saschaszott opened this issue Jun 24, 2024 · 4 comments
Open

SolrDedupServiceImpl: potential bug found in method cleanIndex #462

saschaszott opened this issue Jun 24, 2024 · 4 comments
Labels

Comments

@saschaszott
Copy link

Bug Description

We found a potential bug in method cleanIndex:

Should this check be modified to i != null?

@olli-gold
Copy link

As far as I understand the code I would not say this is a bug. If there is an object in the index, which does not exist in the database, it's removed from the index. If it exists it should not be removed, as long as the index should not be erased completely. If it's expected to erase all of the index, this check is not needed at all and all objects should be unindexed (but I guess it does not make sense to erase the index by iterating through all objects).

So I don't think this is a bug and would guess it's intended as it is.

@saschaszott
Copy link
Author

@olli-gold , thanks. That makes sense. I'll close the issue as won't fix.

@saschaszott
Copy link
Author

saschaszott commented Oct 15, 2024

@olli-gold , I have to reopen this issue.

If i is null, then in

the null value is passed as second method parameter.

Finally, this will result in a NullPointerException in

delete(MessageFormat.format(QUERY_REMOVE, item.getID(), item.getType()));

because of null object access in item.getID() and item.getType(). Do you agree?

@olli-gold
Copy link

Oh, yes, you are right. This is obviously a bug, which needs to be fixed.

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

No branches or pull requests

2 participants