BS-1499: update the condition of the validation of the return type of
data. (check whether the class name is the same)