src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeInt16Array.java
Print this page
*** 113,130 ****
}
}
private void setElem(final int index, final int elem) {
try {
! nb.put(index, (short)elem);
} catch (final IndexOutOfBoundsException e) {
- //swallow valid array indexes. it's ok.
- if (index < 0) {
throw new ClassCastException();
}
}
- }
@Override
public int getInt(final int index) {
return getElem(index);
}
--- 113,129 ----
}
}
private void setElem(final int index, final int elem) {
try {
! if (index < nb.limit()) {
! nb.put(index, (short) elem);
! }
} catch (final IndexOutOfBoundsException e) {
throw new ClassCastException();
}
}
@Override
public int getInt(final int index) {
return getElem(index);
}