{"action":"created","issue":{"url":"https://api.github.com/repos/vigna/fastutil/issues/28","repository_url":"https://api.github.com/repos/vigna/fastutil","labels_url":"https://api.github.com/repos/vigna/fastutil/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/vigna/fastutil/issues/28/comments","events_url":"https://api.github.com/repos/vigna/fastutil/issues/28/events","html_url":"https://github.com/vigna/fastutil/issues/28","id":136292225,"number":28,"title":"Iterator.remove for entry set of ArrayMap throws ArrayIndexOutOfBounds instead of IllegalStateException","user":{"login":"cdman","id":838250,"avatar_url":"https://avatars.githubusercontent.com/u/838250?v=3","gravatar_id":"","url":"https://api.github.com/users/cdman","html_url":"https://github.com/cdman","followers_url":"https://api.github.com/users/cdman/followers","following_url":"https://api.github.com/users/cdman/following{/other_user}","gists_url":"https://api.github.com/users/cdman/gists{/gist_id}","starred_url":"https://api.github.com/users/cdman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdman/subscriptions","organizations_url":"https://api.github.com/users/cdman/orgs","repos_url":"https://api.github.com/users/cdman/repos","events_url":"https://api.github.com/users/cdman/events{/privacy}","received_events_url":"https://api.github.com/users/cdman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-25T06:08:47Z","updated_at":"2016-02-25T21:14:33Z","closed_at":"2016-02-25T21:14:33Z","body":"````java\r\n  @Test(expected = IllegalStateException.class)\r\n  public void testArrayMapEmptyEntrySetThrowsExceptionOnIteratorRemove() {\r\n    ObjectIterator<Entry<Integer, Integer>> iterator = new Int2IntArrayMap().entrySet().iterator();\r\n\r\n    assertFalse(iterator.hasNext());\r\n    iterator.remove();\r\n  }\r\n````\r\n\r\nAccording to [the documentation](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html#remove--) this should throw IllegalStateException (but at least it throws an exception :smile:)."},"comment":{"url":"https://api.github.com/repos/vigna/fastutil/issues/comments/188991658","html_url":"https://github.com/vigna/fastutil/issues/28#issuecomment-188991658","issue_url":"https://api.github.com/repos/vigna/fastutil/issues/28","id":188991658,"user":{"login":"vigna","id":1464942,"avatar_url":"https://avatars.githubusercontent.com/u/1464942?v=3","gravatar_id":"","url":"https://api.github.com/users/vigna","html_url":"https://github.com/vigna","followers_url":"https://api.github.com/users/vigna/followers","following_url":"https://api.github.com/users/vigna/following{/other_user}","gists_url":"https://api.github.com/users/vigna/gists{/gist_id}","starred_url":"https://api.github.com/users/vigna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vigna/subscriptions","organizations_url":"https://api.github.com/users/vigna/orgs","repos_url":"https://api.github.com/users/vigna/repos","events_url":"https://api.github.com/users/vigna/events{/privacy}","received_events_url":"https://api.github.com/users/vigna/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T21:14:33Z","updated_at":"2016-02-25T21:14:33Z","body":"Yes, as I said the implementation of array map was quick and dirty. Fixed."}}