ArrayIndexOutOfBoundsException occurring sporadically in program
<p>I believe I get this exception when the value I'm trying to access is between 26 and 34.  I  don't really understand the numbers at the end of the exception, so any clarification there would be helpful.</p>

<p>whole code can be found here <a href="http://pastebin.com/eMPWYiqm" rel="nofollow">http://pastebin.com/eMPWYiqm</a></p>

<p>Sometimes, it gives me 1 or 6, but its not a consistent error - it only happens every so often which throws me off.  Any help would be appreciated.</p>

<p>Here's the exception:</p>

<pre><code>java.lang.ArrayIndexOutOfBoundsException: 28
    at scripts.RuneSudokuND.populateRuneList(RuneSudokuND.java:496)
    at scripts.RuneSudokuND.loop(RuneSudokuND.java:205)
    at scripts.RuneSudokuND.run(RuneSudokuND.java:51)
    at java.lang.Thread.run(Unknown Source) 
</code></pre>

<p>Here's the code I'm using:</p>

<pre><code>this.runeGrid=new int[82];
this.chests=0;
this.runeGridFillIn=new int[82];
this.currentlySelected=-1;

if(Interfaces.get(288,10)!=null)  {
    if (this.runeGridFillIn[0] == 0) {
        populateRuneList();
        this.runeGridFillIn = Sudoku.solve(this.runeGrid);
        if (this.runeGridFillIn[0] == 99)
            closeInterface();
        return;
    }
}


public void populateRuneList() {
    Interfaces.getAll();
    RSInterfaceChild grid = Interfaces.get(288, 131);
    RSItem[] runeItems = grid.getItems();
    int index = 0;
    for (int i = 0; i &lt; 81; i++) {
        RSInterfaceChild cell = Interfaces.get(288, 10 + i);
        if (cell == null) {
            i--;
        } else if (isCellEmpty(cell)) {
            this.runeGrid[i] = 0;
        } else {
            this.runeGrid[i] = getSudokuIDForRune(runeItems[index].getID());
            index++;
        }
    }
}

public int getSudokuIDForRune(int ID) {
    switch (ID) {
        case 558:
        case 6436:
            return 1;
        case 554:
        case 6428:
            return 2;
        case 559:
        case 6438:
            return 3;
        case 556:
        case 6422:
            return 4;
        case 560:
        case 6432:
            return 5;
        case 555:
        case 6424:
            return 6;
        case 562:
        case 6430:
            return 7;
        case 557:
        case 6426:
            return 8;
        case 563:
        case 6434:
            return 9;
    }
    return 0;
}
</code></pre>
