migrator / guava-libraries-3

Guava: Google Core Libraries for Java 1.6+
0 stars 0 forks source link

BloomFilter.create to accept Funnel<? extends T> instead of Funnel<T> #22

Open migrator opened 9 years ago

migrator commented 9 years ago

For now, BloomFilter.create accepts strictly Funnel which makes it impossible to write type-safe String BloomFilter using builtin funnels:

BloomFilter filter = BloomFilter.create(Funnels.stringFunnel(Charset.defaultCharset()), 10000);

does not compile which is somewhat frustrating.

I'd propose to change BloomFilter.create to accept Funnel<? extends T> which should allow such code.

relevance: 1

migrator commented 9 years ago

summary: Not Defined

Yep, this looks like an oversight on our part. Should be fixed shortly.

status Not Defined creator: kak@google.com created at: Jul 29, 2014

migrator commented 9 years ago

summary: Not Defined

I dont quite ubderstand why you couldn't just go with Funnel?

status Not Defined creator: lowas...@google.com created at: Jul 29, 2014

migrator commented 9 years ago

summary: Not Defined

Also you mean Funnel<? super T>, right?

status Not Defined creator: kak@google.com created at: Jul 29, 2014

migrator commented 9 years ago

summary: Not Defined

2kak@google.com: sure, my bad.

status Not Defined creator: daniil.g...@gmail.com created at: Jul 29, 2014