gsmiller commented on a change in pull request #143: URL: https://github.com/apache/lucene/pull/143#discussion_r634644879
########## File path: lucene/facet/src/java/org/apache/lucene/facet/DrillSideways.java ########## @@ -124,16 +124,34 @@ public DrillSideways( this.executor = executor; } + /** + * Subclass can override to customize drill down facets collector. Returning {@code null} is valid + * if no drill down facet collection is needed. + */ + protected FacetsCollector createDrillDownFacetsCollector() { + return new FacetsCollector(); + } + + /** + * Subclass can override to customize drill down facets collector. Returning {@code null} is valid + * if no drill down facet collection is needed. + */ + protected FacetsCollectorManager createDrillDownFacetsCollectorManager() { + return new FacetsCollectorManager(); + } + /** Subclass can override to customize per-dim Facets impl. */ protected Facets buildFacetsResult( FacetsCollector drillDowns, FacetsCollector[] drillSideways, String[] drillSidewaysDims) throws IOException { - Facets drillDownFacets; + Facets drillDownFacets = null; Review comment: It's actually possible for this to not get initialized (if omitting the line). With my change, it would only get initialized if `drillDowns` is non-null (because of the new conditional checks I added on lines 152/163). The problem arises down on line 175 in cases where `dillDowns` is null. Hope that makes sense. -- 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: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org