diff --git a/src/com/amazon/ion/impl/IonReaderContinuableApplicationBinary.java b/src/com/amazon/ion/impl/IonReaderContinuableApplicationBinary.java index 5844bc7136..f9d2489bd0 100644 --- a/src/com/amazon/ion/impl/IonReaderContinuableApplicationBinary.java +++ b/src/com/amazon/ion/impl/IonReaderContinuableApplicationBinary.java @@ -28,6 +28,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.NoSuchElementException; import static com.amazon.ion.SystemSymbols.IMPORTS_SID; import static com.amazon.ion.SystemSymbols.ION; @@ -367,6 +368,9 @@ public boolean hasNext() { @Override public String next() { + if (index >= idToText.length) { + throw new NoSuchElementException(); + } String symbol = idToText[index]; index++; return symbol; @@ -852,6 +856,7 @@ void readSymbolTable() { } readImportMaxId(); break; + default: throw new IllegalStateException(); } } } @@ -1010,7 +1015,7 @@ public boolean hasNext() { @Override public String next() { - return null; + throw new NoSuchElementException(); } @Override diff --git a/src/com/amazon/ion/impl/_Private_IonConstants.java b/src/com/amazon/ion/impl/_Private_IonConstants.java index 156e8600e6..dc25adbb1f 100644 --- a/src/com/amazon/ion/impl/_Private_IonConstants.java +++ b/src/com/amazon/ion/impl/_Private_IonConstants.java @@ -106,8 +106,7 @@ public static final boolean isSurrogate(int c) { (byte) 0xEA }; /** - * The number of bytes in {@link #BINARY_VERSION_MARKER_1_0} - * ({@value #BINARY_VERSION_MARKER_SIZE}). + * The number of bytes in {@link #BINARY_VERSION_MARKER_1_0}. */ public static final int BINARY_VERSION_MARKER_SIZE = BINARY_VERSION_MARKER_1_0.length;