I may have come across a weird bug in Java. When I'm running the following code, I get "EXCEPTION_ACCESS_VIOLATION" exception.
I know the code doesn't make sense (in terms of logic) because it's a subset of the code I originally wrote. If I remove several lines the bug disappear.
Can anyone figure out what's the cause of this bug?
public static void main(String[] args) {
for (int i=0; i < 4000; i++) {
System.out.println("item " + i);
test1();
}
//runBatch();
System.out.println("Done! bye bye..");
}
public static int test1() {
int count;
int allMiddleCount;
int[] b = new int[0];
allMiddleCount = 0;
for (int i = 1; i < 64; i++)
{
// evaluating the size of the subset
count = 0;
for (int j = 0; j < 6; j++)
count++;
allMiddleCount++;
}
for (int i=0; i < allMiddleCount; i++) {
}
return 0;
}