I'm tyring to better understand the limits of the Key proover for Java. I have come up with a scenario where a specific array element will trigger a null pointer exception. When I run this through the proover it passes. Any idea why this is? It should fail as the null pointer will be thrown at array element 86454. Please note "normal_behaviour" means that it should terminate without exceptions.
/*@
@ normal_behaviour
@ requires true;
@ ensures \result == 7;
@*/
public static int tmp() {
Object[] arr = new Object[999999];
arr[86454] = new Integer(6);
for (int i=0;i<999999;i++){
if (arr[i]!=null && arr[i].equals(new Integer(6))){
throw new NullPointerException();
}
}
return 7;
}