Sample program
public class test
{
public static void main(String [] args)
{
int [] test = new int[6];
int pos = 0;
test[pos++]++;
System.out.println(pos);
}
}
pos correctly prints 1, however simply entering the following into the interactions plane prints 2
int [] test = new int[6]; int pos = 0; test[pos++]++; System.out.println(pos);
As this example shows, the Dynamic Java interpreter that we incorporated into DrJava has bugs. We have fixed some of them (such as failing to use "short-circuit" semantics for && and || in boolean expressions). In a forthcoming release of DrJava, we will either fix this bug or incorporate a new interpreter (supporting Java 8 extensions) that presumably does not share this bug (but may well have others).