Skip to content

Commit

Permalink
java.lang.ArrayIndexOutOfBoundsException when indexing a doc, closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Jul 6, 2011
1 parent c9d619e commit 6f7b462
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -1182,7 +1182,12 @@ private void innerClose() {
}

private Object dirtyLock(String id) {
return dirtyLocks[Math.abs(id.hashCode()) % dirtyLocks.length];
int hash = id.hashCode();
// abs returns Integer.MIN_VALUE, so we need to protect against it...
if (hash == Integer.MIN_VALUE) {
hash = 0;
}
return dirtyLocks[Math.abs(hash) % dirtyLocks.length];
}

private Object dirtyLock(Term uid) {
Expand Down

0 comments on commit 6f7b462

Please sign in to comment.