aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoƮt Gianinetti <benoit.gianinetti@sonarsource.com>2018-11-30 17:40:34 +0100
committersonartech <sonartech@sonarsource.com>2019-02-11 09:11:42 +0100
commitabb6aa64f9b3d74d1c757017a5521036abcfc867 (patch)
tree684b6b1c9fc17208fcbf9be81849682db2c5aef4
parent59ca17e515c97e296458b27782f9c8290cd9f13f (diff)
downloadsonarqube-abb6aa64f9b3d74d1c757017a5521036abcfc867.tar.gz
sonarqube-abb6aa64f9b3d74d1c757017a5521036abcfc867.zip
SONAR-11515 Drop support for old reports
-rw-r--r--server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/IssueCreationDateCalculator.java7
-rw-r--r--server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualityprofile/ActiveRule.java3
-rw-r--r--server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/LoadQualityProfilesStep.java2
3 files changed, 3 insertions, 9 deletions
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/IssueCreationDateCalculator.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/IssueCreationDateCalculator.java
index 71ffffe9755..f8dd1623d6b 100644
--- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/IssueCreationDateCalculator.java
+++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/issue/IssueCreationDateCalculator.java
@@ -100,12 +100,7 @@ public class IssueCreationDateCalculator extends IssueVisitor {
}
}
- private boolean qualityProfileChanged(@Nullable String qpKey) {
- // Support issue from report created before scanner protocol update -> no backdating
- if (qpKey == null) {
- return false;
- }
-
+ private boolean qualityProfileChanged(String qpKey) {
return qProfileStatusRepository.get(qpKey).filter(s -> !s.equals(UNCHANGED)).isPresent();
}
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualityprofile/ActiveRule.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualityprofile/ActiveRule.java
index eb4e969a2cd..a946b308751 100644
--- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualityprofile/ActiveRule.java
+++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/qualityprofile/ActiveRule.java
@@ -35,7 +35,7 @@ public class ActiveRule {
private final long updatedAt;
private final String qProfileKey;
- public ActiveRule(RuleKey ruleKey, String severity, Map<String, String> params, long updatedAt, @Nullable String pluginKey, @Nullable String qProfileKey) {
+ public ActiveRule(RuleKey ruleKey, String severity, Map<String, String> params, long updatedAt, @Nullable String pluginKey, String qProfileKey) {
this.ruleKey = ruleKey;
this.severity = severity;
this.pluginKey = pluginKey;
@@ -65,7 +65,6 @@ public class ActiveRule {
return pluginKey;
}
- @CheckForNull
public String getQProfileKey() {
return qProfileKey;
}
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/LoadQualityProfilesStep.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/LoadQualityProfilesStep.java
index 4b827714cca..7c2a7430009 100644
--- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/LoadQualityProfilesStep.java
+++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/step/LoadQualityProfilesStep.java
@@ -73,6 +73,6 @@ public class LoadQualityProfilesStep implements ComputationStep {
private static ActiveRule convert(ScannerReport.ActiveRule input, Rule rule) {
RuleKey key = RuleKey.of(input.getRuleRepository(), input.getRuleKey());
Map<String, String> params = new HashMap<>(input.getParamsByKeyMap());
- return new ActiveRule(key, input.getSeverity().name(), params, input.getUpdatedAt(), rule.getPluginKey(), emptyToNull(input.getQProfileKey()));
+ return new ActiveRule(key, input.getSeverity().name(), params, input.getUpdatedAt(), rule.getPluginKey(), input.getQProfileKey());
}
}