【发布时间】:2020-10-30 22:42:45
【问题描述】:
我刚开始使用 OpenJML,这里是我的代码和我的 JML 警告:
代码:
//@ 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 警告:
我不明白为什么无法建立异常后置条件。
谢谢你的帮助
【问题讨论】: