Use Correct NoSuchElementException
This commit is contained in:
parent
e4a985f6ac
commit
16e12b45f8
@ -25,12 +25,12 @@ import io.netty.util.internal.PlatformDependent;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.ConcurrentModificationException;
|
import java.util.ConcurrentModificationException;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
public final class MessageList<T> implements Iterable<T> {
|
public final class MessageList<T> implements Iterable<T> {
|
||||||
|
|
||||||
private static final int DEFAULT_INITIAL_CAPACITY = 8;
|
private static final int DEFAULT_INITIAL_CAPACITY = 8;
|
||||||
private static final int MIN_INITIAL_CAPACITY = 4;
|
private static final int MIN_INITIAL_CAPACITY = 4;
|
||||||
private int modifications;
|
|
||||||
|
|
||||||
private static final Recycler<MessageList<?>> RECYCLER = new Recycler<MessageList<?>>() {
|
private static final Recycler<MessageList<?>> RECYCLER = new Recycler<MessageList<?>>() {
|
||||||
@Override
|
@Override
|
||||||
@ -141,6 +141,7 @@ public final class MessageList<T> implements Iterable<T> {
|
|||||||
private final Handle handle;
|
private final Handle handle;
|
||||||
private T[] elements;
|
private T[] elements;
|
||||||
private int size;
|
private int size;
|
||||||
|
private int modifications;
|
||||||
|
|
||||||
MessageList(Handle handle) {
|
MessageList(Handle handle) {
|
||||||
this(handle, DEFAULT_INITIAL_CAPACITY);
|
this(handle, DEFAULT_INITIAL_CAPACITY);
|
||||||
@ -405,7 +406,7 @@ public final class MessageList<T> implements Iterable<T> {
|
|||||||
if (hasNext()) {
|
if (hasNext()) {
|
||||||
return elements[index++];
|
return elements[index++];
|
||||||
}
|
}
|
||||||
throw new UnsupportedOperationException();
|
throw new NoSuchElementException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user