diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-03-15 12:05:23 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-03-16 19:42:10 +0100 |
commit | 1493707a0c2acc5470adf281167eaeebb0272d50 (patch) | |
tree | c0125a9fa59b799074e6eedddd289e09363cf91e /sonar-batch | |
parent | 0c0d65aec9621e191245ba7a41baca618129ebbb (diff) | |
download | sonarqube-1493707a0c2acc5470adf281167eaeebb0272d50.tar.gz sonarqube-1493707a0c2acc5470adf281167eaeebb0272d50.zip |
Fix quality flaws
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java | 3 | ||||
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/rule/QProfileVerifier.java | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java b/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java index c62ccd63c56..4654892fb57 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java +++ b/sonar-batch/src/main/java/org/sonar/batch/report/ReportPublisher.java @@ -52,6 +52,7 @@ import org.sonarqube.ws.WsCe; import org.sonarqube.ws.client.PostRequest; import org.sonarqube.ws.client.WsResponse; +import static org.apache.commons.lang.StringUtils.trimToEmpty; import static org.sonar.core.util.FileUtils.deleteQuietly; @BatchSide @@ -230,7 +231,7 @@ public class ReportPublisher implements Startable { * See https://jira.sonarsource.com/browse/SONAR-4239 */ private String publicUrl() { - String baseUrl = settings.getString(CoreProperties.SERVER_BASE_URL); + String baseUrl = trimToEmpty(settings.getString(CoreProperties.SERVER_BASE_URL)); if (baseUrl.equals(settings.getDefaultValue(CoreProperties.SERVER_BASE_URL))) { // crap workaround for https://jira.sonarsource.com/browse/SONAR-7109 // If server base URL was not configured in Sonar server then is is better to take URL configured on batch side diff --git a/sonar-batch/src/main/java/org/sonar/batch/rule/QProfileVerifier.java b/sonar-batch/src/main/java/org/sonar/batch/rule/QProfileVerifier.java index 00ecc85f700..6206a289f17 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/rule/QProfileVerifier.java +++ b/sonar-batch/src/main/java/org/sonar/batch/rule/QProfileVerifier.java @@ -28,6 +28,8 @@ import org.sonar.api.batch.fs.FileSystem; import org.sonar.api.config.Settings; import org.sonar.api.utils.MessageException; +import static org.apache.commons.lang.StringUtils.isNotEmpty; + @BatchSide public class QProfileVerifier { @@ -57,7 +59,7 @@ public class QProfileVerifier { logger.warn("No Quality profile found for language " + lang); } else { logger.info("Quality profile for {}: {}", lang, profile.getName()); - if (StringUtils.isNotBlank(defaultName) && defaultName.equals(profile.getName())) { + if (isNotEmpty(defaultName) && defaultName.equals(profile.getName())) { defaultNameUsed = true; } } |