gsmiller commented on PR #13950: URL: https://github.com/apache/lucene/pull/13950#issuecomment-2435485794
> This LGTM but it has been this way for so long I wonder if someone with more historical knowledge will have a rationale for hiding these things? I took a quick peek at the git history and it looks like: 1. `#getClauses` was added back in LUCENE-6944 as a new method and hasn't been touched since. I would guess it was added with the most limited access visibility required as a default practice? 2. `#isPureDisjunction` was added in LUCENE-7386 in a pattern that looks similar to above (only added with necessary pkg-internal visibility). 3. `#isTwoClausePureDisjunctionWithTerms` was added recently in #13036, and looks like yet another situation where only the necessary visibility was given for the reason it was being added. So tl;dr: it looks like access was restricted as a good practice for the use-cases they were being added for. IMO, I think it's fine to expose `#getClauses(Occur)` since it does provide a better way to access data already being publicly exposed (i.e., makes sense to not require the client to iterate all the clauses when there's a better way to directly do this). I'm a little less convinced on the other two though. Is there a concrete use-case for exposing these? While, on one hand, it's not really leaking any internals to do this, it's also something the calling code can figure out on its own just as easily with what's already provided. While it's nice for calling code to not have to reimplement this logic, it's also nice to keep the API surface tight. Maybe there's a good motivating use-case though (and sorry if I missed this somewhere)? -- 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