I have a for-loop that is running through an array of size 512 (index range 0 - 511). However, when i == 512, it continues into the loop anyways throwing an ArrayIndexOutOfBounds exception. The screenshot below shows my code when I run it in debug mode with the stop condition set to i == 512.
Anyone have any idea why this loop is continuing to cycle even after the exit condition is met?
Your loop condition is:
i < frameSet * associativity + associativity
According to the debugger, the current values are
512 < 64 * 8 + 8 or
512 < 520, which evaluates to true. That is why the loop is still running.