From 097eab62667dc78eeb36b578e9a74b889c702361 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 20 Jun 2014 15:04:58 +0200 Subject: [PATCH] Change QProfileName.toString() --- .../org/sonar/server/qualityprofile/QProfileName.java | 10 +++------- .../sonar/server/qualityprofile/QProfileNameTest.java | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileName.java b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileName.java index a3fdc520447..783da3ec7bf 100644 --- a/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileName.java +++ b/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileName.java @@ -19,8 +19,6 @@ */ package org.sonar.server.qualityprofile; -import com.google.common.base.Objects; - import javax.annotation.Nullable; public class QProfileName { @@ -41,7 +39,8 @@ public class QProfileName { @Override public boolean equals(@Nullable Object o) { - if (this == o) return true; + if (this == o) + return true; if (o == null || getClass() != o.getClass()) { return false; } @@ -63,9 +62,6 @@ public class QProfileName { @Override public String toString() { - return Objects.toStringHelper("QProfile") - .add("lang", lang) - .add("name", name) - .toString(); + return String.format("[%s, %s]", lang, name); } } diff --git a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java index 4929a9e33db..00062ff8de9 100644 --- a/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java +++ b/sonar-server/src/test/java/org/sonar/server/qualityprofile/QProfileNameTest.java @@ -41,6 +41,6 @@ public class QProfileNameTest { @Test public void to_string() throws Exception { - assertThat(new QProfileName("xoo", "p1").toString()).isEqualTo("QProfile{lang=xoo, name=p1}"); + assertThat(new QProfileName("xoo", "p1").toString()).isEqualTo("[xoo, p1]"); } } -- 2.39.5