Description of problem: In the code for translation memory search, multiple results that have the same source and translation text are combined into a single summary result. Looking at the code where this happens (TranslationMemoryServiceImpl.addOrIncrementResultItem) it appears there are two problems: - result item is given the match type of whichever result appears first. The match type does not change even from 'translated' to 'approved', so the editor will always show the lower result type of 'translated'. - id for imported TM items is added to a list, which is later used to look up text flows. Since both use a Long type for the id, there is no error but it could return non-matching text flows that happen to have the same id as the imported TM item. The ids are sent to the client by GetTransMemoryHandler, then the client returns them to GetTransMemoryDetailsHandler which uses them to look up text flows. The DTOs should change to include all the match types that occur (rather than just a single match type), and the ID for imported TM items and text flows should be wrapped in distinct types so that GetTransMemoryDetailsHandler can treat each appropriately.
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-286