private void signalCopiedTranslation( HTextFlowTarget target, ContentState previousState, Long wordCount) { /* * Using a direct method call instead of an event because it's easier to * read. Since these events are being called synchronously (as opposed * to an 'after Transaction' events), there is no big performance gain * and makes the code easier to read and navigate. */ // TODO how was this not causing duplicate events? Is this bypassing TranslationServiceImpl? // FIXME other observers may not be notified HDocument document = target.getTextFlow().getDocument(); DocumentLocaleKey key = new DocumentLocaleKey(document.getId(), target.getLocaleId()); Map<ContentState, Long> contentStates = Maps.newHashMap(); DocStatsEvent.updateContentStateDeltas( contentStates, target.getState(), previousState, wordCount); DocStatsEvent docEvent = new DocStatsEvent( key, document.getProjectIteration().getId(), contentStates, target.getId()); versionStateCacheImpl.docStatsUpdated(docEvent); }