aggregateknowledge / java-hll

Java library for the HyperLogLog algorithm
http://research.neustar.biz/2013/12/24/open-source-release-java-hll/
Apache License 2.0
311 stars 70 forks source link

java.lang.NoSuchMethodError: it.unimi.dsi.fastutil.longs.LongOpenHashSet.clone() #12

Open subprotocol opened 9 years ago

subprotocol commented 9 years ago

I've found a condition where a NoSuchMethodError can be thrown. Below is what I do to get it to trigger (I hope you don't mind that it's in scala). I am using hll version 1.6.0 out of maven.

val h1 = new HLL(13, 5)
val h2 = new HLL(13, 5)
h2.addRaw(2)
h1.union(h2) // <-- exception here

results in:

Exception in thread "main" java.lang.NoSuchMethodError: it.unimi.dsi.fastutil.longs.LongOpenHashSet.clone()Lit/unimi/dsi/fastutil/longs/LongOpenHashSet;
    at net.agkn.hll.HLL.heterogenousUnion(HLL.java:679)
    at net.agkn.hll.HLL.union(HLL.java:639)

Is anyone else running into this issue?

hossman commented 9 years ago

I attempted to reproduce this problem via a patch to SparseHLLTest.java (not really sure if this is the optimal test class, but i noticed some existing EMPTY union tests there) and was unable to reproduce the described bug.

I suspect the initial bug report was due to a classpath issue (ie: multiple versions of the same depedent jar containing it.unimi.dsi.fastutil.longs.LongOpenHashSet)

https://gist.github.com/hossman/eda007700e0f6183654e