I just started to use OpenJML, here my code and my JML warning:
Code :
//@ requires myArray != null ;
//@ ensures myArray == \old(myArray) ;
//@ signals ( MathLibException ) myArray.size() == 1 ;
public ArrayList<Integer> ExceptionTest1 (ArrayList<Integer> myArray) throws MathLibException
{
if ( myArray.size() == 1 )
{
throw new MathLibException();
}
else
return arraylist;
}
JML warnings :
I don't understand why the exceptional post condition can't be established.
Thank you, for your help
Problem resolved,
my exception wasn't pure, with this code, it is working :