mkodekar / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For now,  BloomFilter.create accepts strictly Funnel<T> which makes it 
impossible to write type-safe String BloomFilter using builtin funnels:

BloomFilter<String> 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.

Original issue reported on code.google.com by daniil.g...@gmail.com on 29 Jul 2014 at 7:55

GoogleCodeExporter commented 9 years ago
Yep, this looks like an oversight on our part. Should be fixed shortly.

Original comment by kak@google.com on 29 Jul 2014 at 8:16

GoogleCodeExporter commented 9 years ago
I dont quite ubderstand why you couldn't just go with Funnel<CharSequence>?

Original comment by lowas...@google.com on 29 Jul 2014 at 8:20

GoogleCodeExporter commented 9 years ago
Also you mean Funnel<? super T>, right?

Original comment by kak@google.com on 29 Jul 2014 at 8:20

GoogleCodeExporter commented 9 years ago
2kak@google.com: sure, my bad.

Original comment by daniil.g...@gmail.com on 29 Jul 2014 at 8:22

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:08

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:07