[ https://issues.apache.org/jira/browse/LUCENE-10467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yuting Gan updated LUCENE-10467: -------------------------------- Description: Currently, there are different behaviors from subclass that implements `getAllDims` and `getTopChildren` when passing in an invalid TopN parameter (`topN <= 0`). Some overridden implementations throw a `NullPointerException`, some throw an `IllegalArgumentException`, and others do not throw any exception. It would provide better user experience by consistently throwing an IllegalArgumentException when requesting topN <= 0 for these two functionalities across all implementations. was: Currently, when calling getAllDims(0) in SortedSetDocValuesFacetCounts, it would throw a NullPointerException. Other class that implements the getAllDims functionality could have the same issue, except for TaxonomyFacetCounts, which has been tested. It would provide better user experience by throwing an IllegalArgumentException when requesting topN <= 0 for getAllDims. > Throws IllegalArgumentException for getAllDims and getTopChildren if topN <= 0 > ------------------------------------------------------------------------------ > > Key: LUCENE-10467 > URL: https://issues.apache.org/jira/browse/LUCENE-10467 > Project: Lucene - Core > Issue Type: Improvement > Components: modules/facet > Reporter: Yuting Gan > Priority: Minor > Time Spent: 10m > Remaining Estimate: 0h > > Currently, there are different behaviors from subclass that implements > `getAllDims` and `getTopChildren` when passing in an invalid TopN parameter > (`topN <= 0`). Some overridden implementations throw a > `NullPointerException`, some throw an `IllegalArgumentException`, and others > do not throw any exception. > It would provide better user experience by consistently throwing an > IllegalArgumentException when requesting topN <= 0 for these two > functionalities across all implementations. -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org