You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/12/01 19:14:55 UTC
[GitHub] [lucene] sonatype-lift[bot] commented on a change in pull request #499: LUCENE-10233: Use AND NOT for inverse intersector
sonatype-lift[bot] commented on a change in pull request #499:
URL: https://github.com/apache/lucene/pull/499#discussion_r760497387
##########
File path: lucene/core/src/java/org/apache/lucene/document/LatLonPointDistanceQuery.java
##########
@@ -295,6 +295,12 @@ public void visit(int docID) {
cost[0]--;
}
+ @Override
+ public void visit(DocIdSetIterator iterator) throws IOException {
+ result.andNot(iterator);
+ cost[0] -= iterator.cost();
Review comment:
*NarrowingCompoundAssignment:* Compound assignments from long to int hide lossy casts [(details)](https://errorprone.info/bugpattern/NarrowingCompoundAssignment)
(at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
##########
File path: lucene/core/src/java/org/apache/lucene/search/PointRangeQuery.java
##########
@@ -217,6 +217,12 @@ public void visit(int docID) {
cost[0]--;
}
+ @Override
+ public void visit(DocIdSetIterator iterator) throws IOException {
+ result.andNot(iterator);
+ cost[0] -= iterator.cost();
Review comment:
*NarrowingCompoundAssignment:* Compound assignments from long to int hide lossy casts [(details)](https://errorprone.info/bugpattern/NarrowingCompoundAssignment)
(at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
##########
File path: lucene/core/src/java/org/apache/lucene/util/FixedBitSet.java
##########
@@ -351,16 +351,34 @@ private void and(final long[] otherArr, final int otherNumWords) {
}
}
+ public void andNot(DocIdSetIterator iter) throws IOException {
+ if (BitSetIterator.getFixedBitSetOrNull(iter) != null) {
+ checkUnpositioned(iter);
+ final FixedBitSet bits = BitSetIterator.getFixedBitSetOrNull(iter);
+ andNot(bits);
Review comment:
*NULL_DEREFERENCE:* object `bits` last assigned on line 357 could be null and is dereferenced by call to `andNot(...)` at line 358.
(at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org