entity = null;
}
return cls.cast(lastEntity);
} catch (Exception ex) {
throw new MessageProcessingException(ex);
}
} else {
throw new MessageProcessingException("No message body reader for class: " + cls);
}
} else if (entity != null && cls.isAssignableFrom(entity.getClass())) {
lastEntity = entity;
return cls.cast(lastEntity);
}