Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Add more checks for stale TM results
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Oct 12, 2015
1 parent 4460c1f commit a01bb38
Showing 1 changed file with 13 additions and 6 deletions.
Expand Up @@ -807,28 +807,35 @@ public boolean apply(Object[] input) {
HTextFlowTarget target = (HTextFlowTarget) entity;

if (!target.getState().isTranslated()) {
log.warn("Unexpected TFT with state {}: {}",
target.getState(), entity);
log.error(
"Unexpected TFT with state {}: {}. You may need to re-index.",
target.getState(), target);
return false;
} else {
HProjectIteration version =
target.getTextFlow().getDocument()
.getProjectIteration();
if (version.getStatus() == EntityStatus.OBSOLETE) {
log.debug("Discarding TFT result from obsolete iteration {}: {}",
version, entity);
version, target);
return false;
} else if (version.getProject().getStatus() ==
EntityStatus.OBSOLETE) {
log.debug("Discarding TFT result from obsolete project {}: {}",
version.getProject(), entity);
version.getProject(), target);
return false;
}
}
return true;
} else if (entity == null) {
log.error(
"Query results include null entity. You may need to re-index.");
} else {
log.error(
"Unexpected query result of type {}: {}. You may need to re-index.",
entity.getClass().getName(), entity);
}
log.warn("Unexpected query result of type {}: {}", entity.getClass().getName(), entity);
return true;
return false;
}
}

Expand Down

0 comments on commit a01bb38

Please sign in to comment.