iterator.remove wrong state checking added

pull/243/head
Nikita 10 years ago
parent af773c3713
commit a0f3bc9d06

@ -116,6 +116,9 @@ public class RedissonKeys implements RKeys {
if (removeExecuted) { if (removeExecuted) {
throw new IllegalStateException("Element been already deleted"); throw new IllegalStateException("Element been already deleted");
} }
if (iter == null) {
throw new IllegalStateException();
}
iter.remove(); iter.remove();
delete(value); delete(value);

@ -115,9 +115,10 @@ public class RedissonSet<V> extends RedissonExpirable implements RSet<V> {
if (removeExecuted) { if (removeExecuted) {
throw new IllegalStateException("Element been already deleted"); throw new IllegalStateException("Element been already deleted");
} }
if (iter == null) {
throw new IllegalStateException();
}
// lazy init iterator
// hasNext();
iter.remove(); iter.remove();
RedissonSet.this.remove(value); RedissonSet.this.remove(value);
removeExecuted = true; removeExecuted = true;

Loading…
Cancel
Save