Add in missing Java std::list listIterator index range checking

This commit is contained in:
William S Fulton 2017-06-29 19:32:34 +01:00
commit 44cd658a53
3 changed files with 38 additions and 0 deletions

View file

@ -55,6 +55,8 @@ namespace std {
private Iterator last;
private java.util.ListIterator<$typemap(jboxtype, T)> init(int index) {
if (index < 0 || index > $javaclassname.this.size())
throw new IndexOutOfBoundsException("Index: " + index);
pos = $javaclassname.this.begin();
pos = pos.advance_unchecked(index);
return this;