When the OptimisticLockingException is generated with the static function lockFailedVersionMismatch and the passed parameters are DateTime instances, the exception could not be thrown because the DateTime object is not implicitly converted to a string.
Removed unnecessary is_object() check
Merge pull request #807 from janbster/fix-optimisticlock

Fix for OptimisticLockingException