albertogoffi / toradocu

Toradocu - automated generation of test oracles from Javadoc documentation
Other
42 stars 21 forks source link

Bad translation on otherwise-clause of @returns #83

Closed bjkeller closed 7 years ago

bjkeller commented 7 years ago

When given

/**
 * @returns true if x is positive, false otherwise 
 */
public static boolean isPositive(int x) {
  return x > 0;
}

Toradocu is generating the condition x==false ? result == true instead of x > 0 ? result == true : result == false.

If the @returns-clause is returns true if x is positive, then it does return x > 0 ? result == true.

albertogoffi commented 7 years ago

Support for this kind of comment has been introduced with commit d93eb785b3aa1cf1b878e4c3246e2f978f8e3147. I keep this open in case we find similar comments for which the current implementation doesn't work.

albertogoffi commented 7 years ago

Time to close this issue.