0

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 :

JML warnings

I don't understand why the exceptional post condition can't be established.

Thank you, for your help

Jan Černý
  • 1,268
  • 2
  • 17
  • 31
Gabriel
  • 1
  • 1

1 Answers1

0

Problem resolved,

my exception wasn't pure, with this code, it is working :

    public /*@ pure @*/ MathLibException() {
}
Gabriel
  • 1
  • 1