Open mernst opened 7 years ago
Here is another example of a type-incorrect assertion. Toradocu produces the post-condition return.equals(c)
for this routine.
/**
* Converts a {@code Complex[]} array to a {@code double[]} array for the
* range {@code start} - {@code end}.
*
* @param c {@code Complex} array
* @param start start index
* @param end end index
* @return array of the real component
*
* @since 4.0
*/
public static double[] complex2Real(Complex[] c, int start, int end) {
final Range range = IntegerSequence.range(start, end);
int index = 0;
final double d[] = new double[range.size()];
for (Integer i : range) {
d[index] = extractRealFromComplexArray(c, i);
index++;
}
return d;
}
Consider this code from commons-math:
Toradocu generates, as the postcondition,
return.equals(n)
.There are two problems here (which I should have submitted as two separate issues!):