I think that it should return an empty filter as the javadoc says

On Fri 4 Oct 2024, 15:53 Gary D. Gregory, <ggreg...@apache.org> wrote:

> See the new disabled test BloomFilterExtractorTest.
>
> Gary
>
> On 2024/10/04 14:51:55 "Gary D. Gregory" wrote:
> > Hi Claude and all,
> >
> > The method:
> >
> >
> org.apache.commons.collections4.bloomfilter.BloomFilterExtractor.flatten()
> >
> > is documented as always returning a BloomFilter:
> >
> >     /**
> >      * Create a standard (non-layered) Bloom filter by merging all of
> the layers. If
> >      * the filter is empty this method will return an empty Bloom filter.
> >      *
> >      * @return the merged bloom filter.
> >      */
> >
> > But that's not how it's coded, it can return null, the simplest
> reproducer is:
> >
> > BloomFilterExtractor.fromBloomFilterArray(new BloomFilter[0]).flatten()
> -> null
> >
> > Should we:
> >
> > - Change the Javadoc
> > - Change the code
> > -- How should this code be changed?
> > -- Should the method be moved to BloomFilter and use "this" as the
> default filter?
> >
> > TY,
> > Gary
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>

Reply via email to