issueMapper.insert(dto);
}
@Override
protected void doUpdate(DbSession session, Date now, DefaultIssue issue) {
IssueMapper issueMapper = session.getMapper(IssueMapper.class);
IssueDto dto = IssueDto.toDtoForUpdate(issue, projectId(), now);
if (Issue.STATUS_CLOSED.equals(issue.status()) || issue.selectedAt() == null) {
// Issue is closed by scan or changed by end-user
issueMapper.update(dto);
} else {
int count = issueMapper.updateIfBeforeSelectedDate(dto);
if (count == 0) {
// End-user and scan changed the issue at the same time.
// See https://jira.codehaus.org/browse/SONAR-4309
conflictResolver.resolve(issue, issueMapper);
}