diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java index e1299a01365..57460299a54 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java @@ -93,11 +93,14 @@ public class ViolationPersisterDecorator implements Decorator { for (Violation violation : context.getViolations()) { RuleFailureModel pastViolation = selectPastViolation(violation, pastViolationsByRule); if (pastViolation != null) { - // remove violation from past, since would be updated and shouldn't affect other violations anymore + // remove violation, since would be updated and shouldn't affect other violations anymore pastViolationsByRule.remove(violation.getRule(), pastViolation); + violation.setCreatedAt(pastViolation.getCreatedAt()); + } else { + violation.setCreatedAt(null);//avoid plugins to set date } String checksum = getChecksumForLine(checksums, violation.getLineId()); - violationPersister.saveOrUpdateViolation(context.getProject(), violation, pastViolation, checksum); + violationPersister.saveViolation(context.getProject(), violation, checksum); } } |