Avoid duplicate SUBM approvals during submission

ApprovalsUtil.getSubmitter is not guaranteed to return a SUBM approval
if there is one in the input list, for example if there is a corrupt
PatchSetApproval with SUBM <= 0. A database implementation may choke
on an upsert call with multiple entities having the same primary key
(e.g. the old and new SUBM approvals), so explicitly avoid this by
storing approvals in a map by key.

Change-Id: I3d3225744abc434ed991d08c4df573647e1ae712
2 files changed