albertogoffi / toradocu

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

Non-compilable condition (boolean result compared with object) #218

Closed ariannab closed 6 years ago

ariannab commented 6 years ago

Running Toradocu on class org.apache.commons.collections4.comparators.ComparatorChain produces the following condition:

    "returnTag": {
      "comment": "true = ComparatorChain cannot be modified; false = ComparatorChain can still be modified.",
      "kind": "RETURN",
      "condition": "true ? result==target"
    },

The correct condition would be the empty one. Anyway, the real issue is that the produced condition is not even compilable, because it is attempting to compare a boolean result with the target object.

ariannab commented 6 years ago

The symmetric problem (target object compared with boolean value) is found in class org.apache.commons.collections4.functors.AnyPredicate

    "returnTag": {
      "comment": "true if any decorated predicate return true.",
      "kind": "RETURN",
      "condition": "target==true ? result == true : result == false"
    },
ariannab commented 6 years ago

Fixed by #226.