diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-06-30 09:38:41 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-06-30 09:40:15 +0200 |
commit | c5bd5ad0ae4124f42818dfaf4eca2adc8c34423e (patch) | |
tree | a89815a0a0297c5e49cbbd497a47710160f6e20b /sonar-plugin-api | |
parent | 3860f8a3375534d27ce8d57aaa2ea5a335ac9fab (diff) | |
download | sonarqube-c5bd5ad0ae4124f42818dfaf4eca2adc8c34423e.tar.gz sonarqube-c5bd5ad0ae4124f42818dfaf4eca2adc8c34423e.zip |
Fix quality flaws
Diffstat (limited to 'sonar-plugin-api')
5 files changed, 9 insertions, 10 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileExporter.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileExporter.java index a811576ef6b..4e88bc085cc 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileExporter.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileExporter.java @@ -19,15 +19,14 @@ */ package org.sonar.api.profiles; +import java.io.Writer; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; -import org.sonar.api.batch.BatchSide; import org.sonar.api.ExtensionPoint; +import org.sonar.api.batch.BatchSide; import org.sonar.api.server.ServerSide; -import java.io.Writer; - /** * @since 2.3 */ @@ -67,7 +66,7 @@ public abstract class ProfileExporter { } protected final ProfileExporter setSupportedLanguages(String... languages) { - supportedLanguages = (languages != null ? languages : new String[0]); + supportedLanguages = (languages != null) ? languages : new String[0]; return this; } @@ -98,7 +97,7 @@ public abstract class ProfileExporter { return false; } ProfileExporter that = (ProfileExporter) o; - return !(key != null ? !key.equals(that.key) : that.key != null); + return !((key != null) ? !key.equals(that.key) : (that.key != null)); } @Override diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java index d0eeb1ac824..bc37cec75b3 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfileImporter.java @@ -64,7 +64,7 @@ public abstract class ProfileImporter { } protected final ProfileImporter setSupportedLanguages(String... languages) { - supportedLanguages = (languages != null) ? languages : new String[0]; + supportedLanguages = ((languages != null) ? languages : new String[0]); return this; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java index 0c5c511c4ed..fa78cd4edfa 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java @@ -573,7 +573,7 @@ public interface WebService extends Definable<WebService.Context> { * @since 4.4 */ public NewParam setExampleValue(@Nullable Object s) { - this.exampleValue = (s != null ? s.toString() : null); + this.exampleValue = ((s != null) ? s.toString() : null); return this; } @@ -616,7 +616,7 @@ public interface WebService extends Definable<WebService.Context> { * @since 4.4 */ public NewParam setDefaultValue(@Nullable Object o) { - this.defaultValue = (o != null ? o.toString() : null); + this.defaultValue = ((o != null) ? o.toString() : null); return this; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java index 86b240416fb..a9e8e044df5 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java @@ -174,7 +174,7 @@ public final class ZipUtils { private static void doZip(String entryName, File file, ZipOutputStream out) throws IOException { if (file.isDirectory()) { - entryName += '/'; + entryName += "/"; ZipEntry entry = new ZipEntry(entryName); out.putNextEntry(entry); out.closeEntry(); diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/violations/ViolationQuery.java b/sonar-plugin-api/src/main/java/org/sonar/api/violations/ViolationQuery.java index 5f40106efc1..a7f878fe061 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/violations/ViolationQuery.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/violations/ViolationQuery.java @@ -60,7 +60,7 @@ public final class ViolationQuery { * @return the current violation query */ public ViolationQuery setSwitchedOff(boolean b) { - this.switchMode = (b ? SwitchMode.OFF : SwitchMode.ON); + this.switchMode = b ? SwitchMode.OFF : SwitchMode.ON; return this; } |