From c5bd5ad0ae4124f42818dfaf4eca2adc8c34423e Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 30 Jun 2015 09:38:41 +0200 Subject: Fix quality flaws --- .../src/main/java/org/sonar/api/profiles/ProfileExporter.java | 9 ++++----- .../src/main/java/org/sonar/api/profiles/ProfileImporter.java | 2 +- .../src/main/java/org/sonar/api/server/ws/WebService.java | 4 ++-- sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java | 2 +- .../src/main/java/org/sonar/api/violations/ViolationQuery.java | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) (limited to 'sonar-plugin-api') 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 { * @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 { * @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; } -- cgit v1.2.3