int oldStatus = thread.getStatus();
if (oldStatus == WorkflowConstants.STATUS_IN_TRASH) {
continue;
}
thread.setStatus(WorkflowConstants.STATUS_IN_TRASH);
<BUG>mbThreadPersistence.update(thread);
trashVersionLocalService.addTrashVersion(</BUG>
trashEntryId, MBThread.class.getName(),
<BUG>thread.getThreadId(), oldStatus);
mbThreadLocalService.moveDependentsToTrash(</BUG>
user.getUserId(), thread.getThreadId(), trashEntryId);

int oldStatus = thread.getStatus();
if (oldStatus == WorkflowConstants.STATUS_IN_TRASH) {
continue;
}
thread.setStatus(WorkflowConstants.STATUS_IN_TRASH);
mbThreadPersistence.update(thread);
if (oldStatus != WorkflowConstants.STATUS_APPROVED) {
trashVersionLocalService.addTrashVersion(
trashEntryId, MBThread.class.getName(),
thread.getThreadId(), oldStatus);
}
mbThreadLocalService.moveDependentsToTrash(
user.getUserId(), thread.getThreadId(), trashEntryId);
