Jackie-Jiang commented on a change in pull request #6824: URL: https://github.com/apache/incubator-pinot/pull/6824#discussion_r619377305
########## File path: pinot-broker/src/main/java/org/apache/pinot/broker/routing/segmentpruner/interval/Interval.java ########## @@ -78,19 +74,17 @@ public int hashCode() { return result; } + @Nullable public static Interval getIntersection(Interval a, Interval b) { - Preconditions.checkNotNull(a, "Intersect invalid intervals {} and {}", a, b); - Preconditions.checkNotNull(b, "Intersect invalid intervals {} and {}", a, b); if (!a.intersects(b)) { Review comment: It's okay to throw NPE here if there is a bug and we accidentally pass `null` into this method. Actually `Preconditions.checkNotNull()` also throws NPE. Here we just remove the extra check because this method could be called frequently. Added an assert to cache the `null` value in the test -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org