{"action":"created","issue":{"url":"https://api.github.com/repos/addthis/stream-lib/issues/91","labels_url":"https://api.github.com/repos/addthis/stream-lib/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/addthis/stream-lib/issues/91/comments","events_url":"https://api.github.com/repos/addthis/stream-lib/issues/91/events","html_url":"https://github.com/addthis/stream-lib/issues/91","id":92605408,"number":91,"title":"HLL++ offer() always returns true when format SPARSE","user":{"login":"xkrt","id":428187,"avatar_url":"https://avatars.githubusercontent.com/u/428187?v=3","gravatar_id":"","url":"https://api.github.com/users/xkrt","html_url":"https://github.com/xkrt","followers_url":"https://api.github.com/users/xkrt/followers","following_url":"https://api.github.com/users/xkrt/following{/other_user}","gists_url":"https://api.github.com/users/xkrt/gists{/gist_id}","starred_url":"https://api.github.com/users/xkrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xkrt/subscriptions","organizations_url":"https://api.github.com/users/xkrt/orgs","repos_url":"https://api.github.com/users/xkrt/repos","events_url":"https://api.github.com/users/xkrt/events{/privacy}","received_events_url":"https://api.github.com/users/xkrt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-07-02T10:32:24Z","updated_at":"2015-07-08T08:23:47Z","closed_at":null,"body":"Hi,\r\n\r\n`HyperLogLogPlus.offerHashed()` constantly returns `true` in SPARSE format, even if hash already counted.\r\n\r\nhttps://github.com/addthis/stream-lib/blob/master/src/main/java/com/clearspring/analytics/stream/cardinality/HyperLogLogPlus.java#L309\r\n\r\nTest:\r\n```java\r\n@Test\r\npublic void testOffer() {\r\n    HyperLogLogPlus hll = new HyperLogLogPlus(5,25);\r\n    assertTrue(hll.offer(\"ABC\"));\r\n    assertFalse(hll.offer(\"ABC\")); // boom!\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/addthis/stream-lib/issues/comments/119490320","html_url":"https://github.com/addthis/stream-lib/issues/91#issuecomment-119490320","issue_url":"https://api.github.com/repos/addthis/stream-lib/issues/91","id":119490320,"user":{"login":"xkrt","id":428187,"avatar_url":"https://avatars.githubusercontent.com/u/428187?v=3","gravatar_id":"","url":"https://api.github.com/users/xkrt","html_url":"https://github.com/xkrt","followers_url":"https://api.github.com/users/xkrt/followers","following_url":"https://api.github.com/users/xkrt/following{/other_user}","gists_url":"https://api.github.com/users/xkrt/gists{/gist_id}","starred_url":"https://api.github.com/users/xkrt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xkrt/subscriptions","organizations_url":"https://api.github.com/users/xkrt/orgs","repos_url":"https://api.github.com/users/xkrt/repos","events_url":"https://api.github.com/users/xkrt/events{/privacy}","received_events_url":"https://api.github.com/users/xkrt/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T08:23:47Z","updated_at":"2015-07-08T08:23:47Z","body":"While I am experementing with performance of fixed ``offer()`` I found a problem:\r\n```java\r\n@Test\r\npublic void testOfferReturn() {\r\n    HyperLogLogPlus hll = new HyperLogLogPlus(5, 25);\r\n    int uniqOffers = 10000;\r\n    int hllUpdates = 0;\r\n    for (int i = 0; i < uniqOffers; ++i) {\r\n        if (hll.offer(UUID.randomUUID().toString()))\r\n            ++hllUpdates;\r\n    }\r\n    assertEquals(uniqOffers, hllUpdates);\r\n}\r\n```\r\n\r\nTest fails with:\r\n```\r\nExpected :10000\r\nActual   :166\r\n```\r\n\r\nTest run on f4c88af1061b5c1b5c15e4aa81dfd6c1f746780f"}}