aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-ce/src/test/java/org/sonar/ce/app/CeServerTest.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/ce/queue/CeTask.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/ce/settings/ComputeEngineSettings.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/issue/DebtCalculator.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortAggregator.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortCalculator.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/issue/RuleImpl.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/measure/Measure.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureVariations.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/measure/QualityGateStatus.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/metric/MetricImpl.java5
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/period/Period.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/qualitygate/Condition.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/qualitygate/EvaluationResult.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/qualityprofile/QualityProfile.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/exceptions/BadRequestException.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/exceptions/Errors.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/exceptions/Message.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/source/ws/LinesAction.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/user/AbstractUserSession.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/user/ThreadLocalUserSession.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueBuilder.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracking.java4
-rw-r--r--sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java4
-rw-r--r--sonar-db/src/main/java/org/sonar/db/ce/CeActivityDto.java4
-rw-r--r--sonar-db/src/main/java/org/sonar/db/ce/CeQueueDto.java4
-rw-r--r--sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java4
-rw-r--r--sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java4
-rw-r--r--sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/EmailSettings.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/security/UserDetails.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java6
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/CodeColorizerFormat.java4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/batch/DefaultFileLinesContext.java4
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/batch/rule/QProfile.java4
38 files changed, 76 insertions, 74 deletions
diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/app/CeServerTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/app/CeServerTest.java
index c3f82e63524..a83ae3e447b 100644
--- a/server/sonar-ce/src/test/java/org/sonar/ce/app/CeServerTest.java
+++ b/server/sonar-ce/src/test/java/org/sonar/ce/app/CeServerTest.java
@@ -19,7 +19,7 @@
*/
package org.sonar.ce.app;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import javax.annotation.CheckForNull;
@@ -180,7 +180,7 @@ public class CeServerTest {
// if none stops, the test will fail with timeout
}
- Exception exception = Objects.firstNonNull(waitingThread1.getException(), waitingThread2.getException());
+ Exception exception = MoreObjects.firstNonNull(waitingThread1.getException(), waitingThread2.getException());
assertThat(exception)
.isInstanceOf(IllegalStateException.class)
.hasMessage("There can't be more than one thread waiting for the Compute Engine to stop");
diff --git a/server/sonar-server/src/main/java/org/sonar/ce/queue/CeTask.java b/server/sonar-server/src/main/java/org/sonar/ce/queue/CeTask.java
index 391a0d50f85..3dd87f364b7 100644
--- a/server/sonar-server/src/main/java/org/sonar/ce/queue/CeTask.java
+++ b/server/sonar-server/src/main/java/org/sonar/ce/queue/CeTask.java
@@ -19,7 +19,7 @@
*/
package org.sonar.ce.queue;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@@ -76,7 +76,7 @@ public class CeTask {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("componentUuid", componentUuid)
.add("uuid", uuid)
.add("type", type)
diff --git a/server/sonar-server/src/main/java/org/sonar/ce/settings/ComputeEngineSettings.java b/server/sonar-server/src/main/java/org/sonar/ce/settings/ComputeEngineSettings.java
index 5b30a8339c9..2e3f0eafc2c 100644
--- a/server/sonar-server/src/main/java/org/sonar/ce/settings/ComputeEngineSettings.java
+++ b/server/sonar-server/src/main/java/org/sonar/ce/settings/ComputeEngineSettings.java
@@ -19,7 +19,7 @@
*/
package org.sonar.ce.settings;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.collect.Maps;
import java.util.Date;
import java.util.List;
@@ -99,7 +99,7 @@ public class ComputeEngineSettings extends Settings implements ThreadLocalSettin
}
private ServerSettings currentDelegate() {
- return Objects.firstNonNull(threadLocalDelegate.get(), defaultDelegate);
+ return MoreObjects.firstNonNull(threadLocalDelegate.get(), defaultDelegate);
}
private Settings currentSettings() {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/DebtCalculator.java b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/DebtCalculator.java
index f1cc57198fe..613da8894f1 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/DebtCalculator.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/DebtCalculator.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.computation.issue;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
import javax.annotation.CheckForNull;
import org.sonar.api.server.debt.DebtRemediationFunction;
@@ -48,7 +48,7 @@ public class DebtCalculator {
Duration debt = Duration.create(0);
String gapMultiplier =fn.gapMultiplier();
if (fn.type().usesGapMultiplier() && !Strings.isNullOrEmpty(gapMultiplier)) {
- int effortToFixValue = Objects.firstNonNull(issue.effortToFix(), 1).intValue();
+ int effortToFixValue = MoreObjects.firstNonNull(issue.effortToFix(), 1).intValue();
// TODO convert to Duration directly in Rule#remediationFunction -> better performance + error handling
debt = durations.decode(gapMultiplier).multiply(effortToFixValue);
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortAggregator.java b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortAggregator.java
index 76f5386249e..a631eb30364 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortAggregator.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortAggregator.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.computation.issue;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;
import java.util.HashMap;
@@ -158,7 +158,7 @@ public class NewEffortAggregator extends IssueVisitor {
private boolean isEmpty = true;
void add(int periodIndex, long newEffort) {
- double previous = Objects.firstNonNull(sums[periodIndex - 1], 0d);
+ double previous = MoreObjects.firstNonNull(sums[periodIndex - 1], 0d);
sums[periodIndex - 1] = previous + newEffort;
isEmpty = false;
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortCalculator.java b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortCalculator.java
index 33bb53f1a9f..33775f6ae82 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortCalculator.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/NewEffortCalculator.java
@@ -20,7 +20,7 @@
package org.sonar.server.computation.issue;
import com.google.common.base.Function;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
@@ -50,7 +50,7 @@ public class NewEffortCalculator {
public long calculate(DefaultIssue issue, Collection<IssueChangeDto> debtChangelog, Period period) {
if (issue.creationDate().getTime() > period.getSnapshotDate() + 1000L) {
- return Objects.firstNonNull(issue.effortInMinutes(), 0L);
+ return MoreObjects.firstNonNull(issue.effortInMinutes(), 0L);
}
return calculateFromChangelog(issue, debtChangelog, period.getSnapshotDate());
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/RuleImpl.java b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/RuleImpl.java
index b7c91f3e5c5..d1eace80114 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/issue/RuleImpl.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/issue/RuleImpl.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.computation.issue;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import java.util.Set;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
@@ -108,7 +108,7 @@ public class RuleImpl implements Rule {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("id", id)
.add("key", key)
.add("name", name)
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/Measure.java b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/Measure.java
index ffd1cd9c640..ebae93869d7 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/Measure.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/Measure.java
@@ -395,7 +395,7 @@ public final class Measure {
@Override
public String toString() {
- return com.google.common.base.Objects.toStringHelper(this)
+ return com.google.common.base.MoreObjects.toStringHelper(this)
.add("valueType", valueType)
.add("developer", developer)
.add("value", value)
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureVariations.java b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureVariations.java
index 07542c72057..b37d8b44ec8 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureVariations.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureVariations.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.computation.measure;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import java.util.Arrays;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@@ -141,7 +141,7 @@ public final class MeasureVariations {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("1", variations[0])
.add("2", variations[1])
.add("3", variations[2])
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/QualityGateStatus.java b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/QualityGateStatus.java
index cfe1c045716..eaf28b896d9 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/QualityGateStatus.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/QualityGateStatus.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.computation.measure;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@@ -78,7 +78,7 @@ public final class QualityGateStatus {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("status", status)
.add("text", text)
.toString();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/metric/MetricImpl.java b/server/sonar-server/src/main/java/org/sonar/server/computation/metric/MetricImpl.java
index 0cf12caecdf..b4d55aa1bd8 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/metric/MetricImpl.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/metric/MetricImpl.java
@@ -19,6 +19,7 @@
*/
package org.sonar.server.computation.metric;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
@@ -52,7 +53,7 @@ public final class MetricImpl implements Metric {
this.name = checkNotNull(name);
this.type = checkNotNull(type);
if (type.getValueType() == Measure.ValueType.DOUBLE) {
- this.decimalScale = Objects.firstNonNull(decimalScale, org.sonar.api.measures.Metric.DEFAULT_DECIMAL_SCALE);
+ this.decimalScale = MoreObjects.firstNonNull(decimalScale, org.sonar.api.measures.Metric.DEFAULT_DECIMAL_SCALE);
} else {
this.decimalScale = decimalScale;
}
@@ -116,7 +117,7 @@ public final class MetricImpl implements Metric {
@Override
public String toString() {
- return com.google.common.base.Objects.toStringHelper(this)
+ return com.google.common.base.MoreObjects.toStringHelper(this)
.add("id", id)
.add("key", key)
.add("name", name)
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/period/Period.java b/server/sonar-server/src/main/java/org/sonar/server/computation/period/Period.java
index 4544c4d3ce9..da8f2794833 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/period/Period.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/period/Period.java
@@ -23,7 +23,7 @@ import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
-import static com.google.common.base.Objects.toStringHelper;
+import static com.google.common.base.MoreObjects.toStringHelper;
import static java.util.Objects.hash;
import static java.util.Objects.requireNonNull;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/qualitygate/Condition.java b/server/sonar-server/src/main/java/org/sonar/server/computation/qualitygate/Condition.java
index e5f08a6e24c..53b6d38a71a 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/qualitygate/Condition.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/qualitygate/Condition.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.computation.qualitygate;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@@ -116,7 +116,7 @@ public class Condition {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("metric", metric)
.add("period", period)
.add("operator", operator)
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/qualitygate/EvaluationResult.java b/server/sonar-server/src/main/java/org/sonar/server/computation/qualitygate/EvaluationResult.java
index 44836a44a3d..77797279b10 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/qualitygate/EvaluationResult.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/qualitygate/EvaluationResult.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.computation.qualitygate;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@@ -49,7 +49,7 @@ public final class EvaluationResult {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("level", level)
.add("value", value)
.toString();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/qualityprofile/QualityProfile.java b/server/sonar-server/src/main/java/org/sonar/server/computation/qualityprofile/QualityProfile.java
index 68a1397834a..50fa860e562 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/qualityprofile/QualityProfile.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/qualityprofile/QualityProfile.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.computation.qualityprofile;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import java.util.Date;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@@ -80,7 +80,7 @@ public class QualityProfile {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("key", qpKey)
.add("name", qpName)
.add("language", languageKey)
diff --git a/server/sonar-server/src/main/java/org/sonar/server/exceptions/BadRequestException.java b/server/sonar-server/src/main/java/org/sonar/server/exceptions/BadRequestException.java
index a6f3a867ff4..577bc075868 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/exceptions/BadRequestException.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/exceptions/BadRequestException.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.exceptions;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import java.util.List;
import org.sonar.api.utils.ValidationMessages;
@@ -70,7 +70,7 @@ public class BadRequestException extends ServerException {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("errors", errors)
.toString();
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/exceptions/Errors.java b/server/sonar-server/src/main/java/org/sonar/server/exceptions/Errors.java
index a9dc537e69d..c3d0e70805e 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/exceptions/Errors.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/exceptions/Errors.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.exceptions;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.collect.Lists;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.i18n.I18n;
@@ -93,7 +93,7 @@ public class Errors {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("messages", messages)
.toString();
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/exceptions/Message.java b/server/sonar-server/src/main/java/org/sonar/server/exceptions/Message.java
index 19c116dbce4..8949c926d87 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/exceptions/Message.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/exceptions/Message.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.exceptions;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import org.apache.commons.lang.StringUtils;
import javax.annotation.CheckForNull;
@@ -81,7 +81,7 @@ public class Message {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("key", key)
.add("params", params != null ? Arrays.toString(params) : null)
.toString();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java
index b14058875ba..78813f282a4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/ws/SetTagsAction.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.issue.ws;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import org.sonar.api.server.ws.Request;
import org.sonar.api.server.ws.Response;
import org.sonar.api.server.ws.WebService;
@@ -61,7 +61,7 @@ public class SetTagsAction implements IssuesWsAction {
@Override
public void handle(Request request, Response response) throws Exception {
String key = request.mandatoryParam("key");
- List<String> tags = Objects.firstNonNull(request.paramAsStrings("tags"), Collections.<String>emptyList());
+ List<String> tags = MoreObjects.firstNonNull(request.paramAsStrings("tags"), Collections.<String>emptyList());
Collection<String> resultTags = service.setTags(key, tags);
JsonWriter json = response.newJsonWriter().beginObject().name("tags").beginArray();
for (String tag : resultTags) {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java
index dd360186e37..0d75ff26320 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.qualityprofile;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.collect.Maps;
import org.apache.commons.lang.StringUtils;
import org.sonar.db.qualityprofile.ActiveRuleKey;
@@ -118,7 +118,7 @@ public class ActiveRuleChange {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("type", type)
.add("key", key)
.add("severity", severity)
diff --git a/server/sonar-server/src/main/java/org/sonar/server/source/ws/LinesAction.java b/server/sonar-server/src/main/java/org/sonar/server/source/ws/LinesAction.java
index 6eca5487935..e3dbdd0bc39 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/source/ws/LinesAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/source/ws/LinesAction.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.source.ws;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Optional;
import com.google.common.io.Resources;
import java.util.Date;
@@ -119,7 +119,7 @@ public class LinesAction implements SourcesWsAction {
userSession.checkComponentUuidPermission(UserRole.CODEVIEWER, file.projectUuid());
int from = request.mandatoryParamAsInt(PARAM_FROM);
- int to = Objects.firstNonNull(request.paramAsInt(PARAM_TO), Integer.MAX_VALUE);
+ int to = MoreObjects.firstNonNull(request.paramAsInt(PARAM_TO), Integer.MAX_VALUE);
Optional<Iterable<DbFileSources.Line>> lines = sourceService.getLines(dbSession, file.uuid(), from, to);
if (!lines.isPresent()) {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/AbstractUserSession.java b/server/sonar-server/src/main/java/org/sonar/server/user/AbstractUserSession.java
index fb69c36cf46..00d2e2a9208 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/user/AbstractUserSession.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/user/AbstractUserSession.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.user;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Sets;
@@ -117,7 +117,7 @@ public abstract class AbstractUserSession<T extends AbstractUserSession> impleme
}
protected T setLocale(@Nullable Locale l) {
- this.locale = Objects.firstNonNull(l, Locale.ENGLISH);
+ this.locale = MoreObjects.firstNonNull(l, Locale.ENGLISH);
return clazz.cast(this);
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/ThreadLocalUserSession.java b/server/sonar-server/src/main/java/org/sonar/server/user/ThreadLocalUserSession.java
index 3406cf03d05..b8f0fc4a8f4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/user/ThreadLocalUserSession.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/user/ThreadLocalUserSession.java
@@ -19,7 +19,7 @@
*/
package org.sonar.server.user;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
@@ -34,7 +34,7 @@ public class ThreadLocalUserSession implements UserSession {
private static final ThreadLocal<UserSession> THREAD_LOCAL = new ThreadLocal<>();
public UserSession get() {
- return Objects.firstNonNull(THREAD_LOCAL.get(), AnonymousUserSession.INSTANCE);
+ return MoreObjects.firstNonNull(THREAD_LOCAL.get(), AnonymousUserSession.INSTANCE);
}
public void set(UserSession session) {
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueBuilder.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueBuilder.java
index 4f44a40bba1..b89ad385c3a 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueBuilder.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssueBuilder.java
@@ -19,7 +19,7 @@
*/
package org.sonar.core.issue;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import java.util.Map;
@@ -150,7 +150,7 @@ public class DefaultIssueBuilder implements Issuable.IssueBuilder {
DefaultIssue issue = new DefaultIssue();
String key = Uuids.create();
issue.setKey(key);
- issue.setType(Objects.firstNonNull(type, RuleType.CODE_SMELL));
+ issue.setType(MoreObjects.firstNonNull(type, RuleType.CODE_SMELL));
issue.setComponentKey(componentKey);
issue.setProjectKey(projectKey);
issue.setRuleKey(ruleKey);
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracking.java b/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracking.java
index 2f7e326a5c6..d39c9349bf4 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracking.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/tracking/Tracking.java
@@ -19,7 +19,7 @@
*/
package org.sonar.core.issue.tracking;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import java.util.Collection;
@@ -100,7 +100,7 @@ public class Tracking<RAW extends Trackable, BASE extends Trackable> {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("rawToBase", rawToBase)
.add("baseToRaw", baseToRaw)
.add("raws", raws)
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java b/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java
index ec0806d0f3d..2c0ae9a413f 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/PluginInfo.java
@@ -22,7 +22,7 @@ package org.sonar.core.platform;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.Ordering;
@@ -231,7 +231,7 @@ public class PluginInfo implements Comparable<PluginInfo> {
}
public PluginInfo setName(@Nullable String name) {
- this.name = Objects.firstNonNull(name, this.key);
+ this.name = MoreObjects.firstNonNull(name, this.key);
return this;
}
diff --git a/sonar-db/src/main/java/org/sonar/db/ce/CeActivityDto.java b/sonar-db/src/main/java/org/sonar/db/ce/CeActivityDto.java
index 2ad7761d72d..424de69d211 100644
--- a/sonar-db/src/main/java/org/sonar/db/ce/CeActivityDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/ce/CeActivityDto.java
@@ -19,7 +19,7 @@
*/
package org.sonar.db.ce;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
@@ -189,7 +189,7 @@ public class CeActivityDto {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("uuid", uuid)
.add("taskType", taskType)
.add("componentUuid", componentUuid)
diff --git a/sonar-db/src/main/java/org/sonar/db/ce/CeQueueDto.java b/sonar-db/src/main/java/org/sonar/db/ce/CeQueueDto.java
index a3befa42009..8038cd7a9b8 100644
--- a/sonar-db/src/main/java/org/sonar/db/ce/CeQueueDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/ce/CeQueueDto.java
@@ -19,7 +19,7 @@
*/
package org.sonar.db.ce;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
@@ -121,7 +121,7 @@ public class CeQueueDto {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("uuid", uuid)
.add("taskType", taskType)
.add("componentUuid", componentUuid)
diff --git a/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java b/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java
index 570ab0acda4..0f753731ac1 100644
--- a/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/issue/IssueDto.java
@@ -20,7 +20,7 @@
package org.sonar.db.issue;
import com.google.common.base.Joiner;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableSet;
@@ -704,7 +704,7 @@ public final class IssueDto implements Serializable {
issue.setChecksum(checksum);
issue.setSeverity(severity);
issue.setAssignee(assignee);
- issue.setAttributes(KeyValueFormat.parse(Objects.firstNonNull(issueAttributes, "")));
+ issue.setAttributes(KeyValueFormat.parse(MoreObjects.firstNonNull(issueAttributes, "")));
issue.setComponentKey(componentKey);
issue.setComponentUuid(componentUuid);
issue.setModuleUuid(moduleUuid);
diff --git a/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java b/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java
index 1536d9633be..bf71e0dbe8d 100644
--- a/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java
@@ -19,7 +19,7 @@
*/
package org.sonar.db.measure;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import java.nio.charset.StandardCharsets;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
@@ -226,7 +226,7 @@ public class MeasureDto {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("id", id)
.add("value", value)
.add("textValue", textValue)
diff --git a/sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java b/sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java
index d6ca4779623..3f0bfb6d589 100644
--- a/sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/property/PropertyDto.java
@@ -19,6 +19,7 @@
*/
package org.sonar.db.property;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
public class PropertyDto {
@@ -96,7 +97,7 @@ public class PropertyDto {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.addValue(this.key)
.addValue(this.value)
.addValue(this.resourceId)
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/EmailSettings.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/EmailSettings.java
index 59aa02e28e5..60eac6d247e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/EmailSettings.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/EmailSettings.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.config;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import org.sonar.api.CoreProperties;
import org.sonar.api.batch.BatchSide;
import org.sonar.api.ce.ComputeEngineSide;
@@ -88,6 +88,6 @@ public class EmailSettings {
}
private String get(String key, String defaultValue) {
- return Objects.firstNonNull(settings.getString(key), defaultValue);
+ return MoreObjects.firstNonNull(settings.getString(key), defaultValue);
}
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/security/UserDetails.java b/sonar-plugin-api/src/main/java/org/sonar/api/security/UserDetails.java
index a352554d6d9..87b5fe64294 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/security/UserDetails.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/security/UserDetails.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.security;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
/**
* This class is not intended to be subclassed by clients.
@@ -68,7 +68,7 @@ public final class UserDetails {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("name", name)
.add("email", email)
.add("userId", userId)
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java
index 824a7fac706..64624b22bca 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.server.debt.internal;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.apache.commons.lang.StringUtils;
@@ -138,7 +138,7 @@ public class DefaultDebtRemediationFunction implements DebtRemediationFunction {
@Override
public String toString() {
- return Objects.toStringHelper(DebtRemediationFunction.class)
+ return MoreObjects.toStringHelper(DebtRemediationFunction.class)
.add("type", type)
.add("gap multiplier", gapMultiplier)
.add("base effort", baseEffort)
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java
index 20d2def8102..a09bd9df96b 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/rule/RulesDefinition.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.server.rule;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -514,7 +514,7 @@ public interface RulesDefinition {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("key", key)
.add("language", language)
.toString();
@@ -614,7 +614,7 @@ public interface RulesDefinition {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("language", language)
.add("key", key)
.toString();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/CodeColorizerFormat.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/CodeColorizerFormat.java
index 953f639eed7..187777e7cf7 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/web/CodeColorizerFormat.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/CodeColorizerFormat.java
@@ -19,7 +19,7 @@
*/
package org.sonar.api.web;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import org.sonar.api.task.TaskExtension;
import org.sonar.colorizer.Tokenizer;
@@ -75,7 +75,7 @@ public abstract class CodeColorizerFormat implements TaskExtension {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("lang", languageKey)
.toString();
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/batch/DefaultFileLinesContext.java b/sonar-scanner-engine/src/main/java/org/sonar/batch/DefaultFileLinesContext.java
index 85931a2be11..33b773e39c3 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/batch/DefaultFileLinesContext.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/batch/DefaultFileLinesContext.java
@@ -19,7 +19,7 @@
*/
package org.sonar.batch;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableMap;
@@ -173,7 +173,7 @@ public class DefaultFileLinesContext implements FileLinesContext {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("map", map)
.toString();
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/batch/rule/QProfile.java b/sonar-scanner-engine/src/main/java/org/sonar/batch/rule/QProfile.java
index 5abc9955c7d..a0fce1c9c6b 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/batch/rule/QProfile.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/batch/rule/QProfile.java
@@ -19,7 +19,7 @@
*/
package org.sonar.batch.rule;
-import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects;
import java.util.Date;
@@ -86,7 +86,7 @@ public class QProfile {
@Override
public String toString() {
- return Objects.toStringHelper(this)
+ return MoreObjects.toStringHelper(this)
.add("key", key)
.add("name", name)
.add("language", language)