Open saschaszott opened 5 months ago
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.
@olli-gold , thanks. That makes sense. I'll close the issue as won't fix.
@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
because of null object access in item.getID()
and item.getType()
. Do you agree?
Oh, yes, you are right. This is obviously a bug, which needs to be fixed.
Bug Description
We found a potential bug in method
cleanIndex
:https://github.com/4Science/DSpace/blob/04c7aa622a94e048a056dee462d8220592764971/dspace-api/src/main/java/org/dspace/app/deduplication/service/impl/SolrDedupServiceImpl.java#L637
Should this check be modified to
i != null
?