diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2019-09-06 16:26:54 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-03-11 20:04:31 +0000 |
commit | d961c0a405a2d16785e5769dcb5b879c14a997e8 (patch) | |
tree | 39d115f51e7a6589f75bb06e50d878bd781ee837 /sonar-core | |
parent | 5485d4ac2c3c0aee67d6783bfc6203f77edb9b10 (diff) | |
download | sonarqube-d961c0a405a2d16785e5769dcb5b879c14a997e8.tar.gz sonarqube-d961c0a405a2d16785e5769dcb5b879c14a997e8.zip |
SONAR-13093 Optimize cache of issues in Compute Engine
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java | 12 | ||||
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/issue/FieldDiffs.java | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java index 5a81de71b63..cd91a5d4fbe 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java @@ -213,11 +213,12 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure. } @Override + @CheckForNull public String language() { return language; } - public DefaultIssue setLanguage(String l) { + public DefaultIssue setLanguage(@Nullable String l) { this.language = l; return this; } @@ -269,7 +270,7 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure. } public DefaultIssue setLine(@Nullable Integer l) { - Preconditions.checkArgument(l == null || l > 0, "Line must be null or greater than zero (got %d)", l); + Preconditions.checkArgument(l == null || l > 0, "Line must be null or greater than zero (got %s)", l); this.line = l; return this; } @@ -507,6 +508,11 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure. return this; } + public DefaultIssue setCurrentChangeWithoutAddChange(@Nullable FieldDiffs currentChange) { + this.currentChange = currentChange; + return this; + } + @CheckForNull public FieldDiffs currentChange() { return currentChange; @@ -583,7 +589,7 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure. return false; } DefaultIssue that = (DefaultIssue) o; - return !(key != null ? !key.equals(that.key) : (that.key != null)); + return Objects.equals(key, that.key); } @Override diff --git a/sonar-core/src/main/java/org/sonar/core/issue/FieldDiffs.java b/sonar-core/src/main/java/org/sonar/core/issue/FieldDiffs.java index d560d79e174..8113a90c610 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/FieldDiffs.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/FieldDiffs.java @@ -85,11 +85,12 @@ public class FieldDiffs implements Serializable { return this; } + @CheckForNull public String issueKey() { return issueKey; } - public FieldDiffs setIssueKey(String issueKey) { + public FieldDiffs setIssueKey(@Nullable String issueKey) { this.issueKey = issueKey; return this; } |