Baqend / Orestes-Bloomfilter

Library of different Bloom filters in Java with optional Redis-backing, counting and many hashing options.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ambiguous reference of byte[] in countingbloomfilter

lwhite1 opened this issue · comments

 private CountingBloomFilter<byte[]> cbf =
     new FilterBuilder(MAX_KEYS, 0.01).buildCountingBloomFilter();

...

cbf.remove(key)

results in a compilation error:

Error:(73, 8) java: reference to remove is ambiguous
both method remove(byte[]) in orestes.bloomfilter.CountingBloomFilter and method remove(T) in orestes.bloomfilter.CountingBloomFilter match

Casting to a byte[], as below, does not help:

cbf.remove((byte[])key)

produces the same error.

Any help is appreciated.

Hi,

this was indeed a problem. In 1.1.0 the raw byte[] methods now all End with *Raw so that the ambiguity problem for BloomFilter with byte[] as their generic type are gone.

As an explanation: the generic methods all map to the byte methods an use the String representation of the given object in order to derive its byte representation. So you are fine using the *Raw methods and skipping the conversion.