uschindler commented on PR #13389: URL: https://github.com/apache/lucene/pull/13389#issuecomment-2120877177
> > The method is only intended to be called by Lucene code. > > Then it should not be a public API. > > Agree with comment by @romseygeek that since DisjunctionIntervalsSource returns `null` [here](https://github.com/apache/lucene/blob/main/lucene/queries/src/java/org/apache/lucene/queries/intervals/DisjunctionIntervalsSource.java#L79) when there are no sub-iterators, callers would already be performing null checks. > > So, this change is not backward incompatible. Could you please stop arguing about `intervals()` returning null? It is documented here: https://github.com/apache/lucene/blob/22d50be2eab84c9a75ea65f55fcc4356724faba1/lucene/queries/src/java/org/apache/lucene/queries/intervals/IntervalsSource.java#L35-L45 So whenever you call `intervals()` you must be prepared that it returns null (if no intervals match/found). So there is no backwards break. The class implementing that can return null or an empty iterator as it likes. The caller has to make sure that it can handle it. The class which implements the interface for the specific case you mention is private, so the only spec which is responsible for null/non-null is the above. So please stop arguing. The change is backwards compatible. If there is code out there that stumbles on this, it was a bug from the beginning. Lucene has a quite relaxed backwards compatibility regulation as very strict ones stop invention of new features. -- 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-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org