diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2017-10-02 10:28:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-02 10:28:58 +0200 |
commit | 8115d8b7e41c38120650bac7432291c722b9a7c3 (patch) | |
tree | fa1799aab7cd353475b32d622b4a0408de84cac0 /sonar-core | |
parent | 583e42c16797bf57162ebd502e12241d8765a8fc (diff) | |
download | sonarqube-8115d8b7e41c38120650bac7432291c722b9a7c3.tar.gz sonarqube-8115d8b7e41c38120650bac7432291c722b9a7c3.zip |
SONAR-6959 Performance improvements
* Avoid creation of intermediary array
* SONAR-6959 Speed-up copy of custom measures in Compute Engine
* Use light object to get key/uuid map of components
* Avoid always formatting string
* Minor refactoring
* Avoid cost of hash
* Ajust perf tests
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java | 5 |
1 files changed, 2 insertions, 3 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 9685a49bb06..198515da6d0 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 @@ -48,7 +48,6 @@ import org.sonar.api.rules.RuleType; import org.sonar.api.utils.Duration; import org.sonar.core.issue.tracking.Trackable; -import static java.lang.String.format; import static org.sonar.api.utils.DateUtils.truncateToSeconds; public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure.Issue { @@ -258,7 +257,7 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure. } public DefaultIssue setLine(@Nullable Integer l) { - Preconditions.checkArgument(l == null || l > 0, format("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 %d)", l); this.line = l; return this; } @@ -280,7 +279,7 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure. } public DefaultIssue setGap(@Nullable Double d) { - Preconditions.checkArgument(d == null || d >= 0, format("Gap must be greater than or equal 0 (got %s)", d)); + Preconditions.checkArgument(d == null || d >= 0, "Gap must be greater than or equal 0 (got %s)", d); this.gap = d; return this; } |