diff options
5 files changed, 15 insertions, 11 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/InitialOpenIssuesStack.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/InitialOpenIssuesStack.java index 7fc7cd6232e..10a41111771 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/InitialOpenIssuesStack.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/InitialOpenIssuesStack.java @@ -20,7 +20,7 @@ package org.sonar.plugins.core.issue; -import edu.emory.mathcs.backport.java.util.Collections; +import java.util.Collections; import org.sonar.api.BatchExtension; import org.sonar.api.batch.InstantiationStrategy; import org.sonar.batch.index.Cache; @@ -75,7 +75,7 @@ public class InitialOpenIssuesStack implements BatchExtension { public List<IssueChangeDto> selectChangelog(String issueKey) { List<IssueChangeDto> changeDtos = issuesChangelogCache.get(issueKey); - return changeDtos != null ? changeDtos : Collections.emptyList(); + return changeDtos != null ? changeDtos : Collections.<IssueChangeDto>emptyList(); } public void clear() { diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/InitialOpenIssuesStackTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/InitialOpenIssuesStackTest.java index 590f9bd5e84..a32ea0bb51d 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/InitialOpenIssuesStackTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/InitialOpenIssuesStackTest.java @@ -20,7 +20,7 @@ package org.sonar.plugins.core.issue; -import edu.emory.mathcs.backport.java.util.Collections; +import java.util.Collections; import org.junit.After; import org.junit.Before; import org.junit.ClassRule; @@ -45,7 +45,9 @@ public class InitialOpenIssuesStackTest { public static TemporaryFolder temp = new TemporaryFolder(); public static Caches createCacheOnTemp(TemporaryFolder temp) { - BootstrapSettings bootstrapSettings = new BootstrapSettings(new BootstrapProperties(Collections.emptyMap())); + BootstrapSettings bootstrapSettings = new BootstrapSettings( + new BootstrapProperties(Collections.<String,String>emptyMap()) + ); try { bootstrapSettings.properties().put(CoreProperties.WORKING_DIRECTORY, temp.newFolder().getAbsolutePath()); } catch (IOException e) { diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java index c8d5fc7dc0e..2e206f93071 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java @@ -19,7 +19,7 @@ */ package org.sonar.batch.index; -import edu.emory.mathcs.backport.java.util.Collections; +import java.util.Collections; import org.junit.After; import org.junit.Before; import org.junit.ClassRule; @@ -43,7 +43,9 @@ public class CachesTest { public static TemporaryFolder temp = new TemporaryFolder(); public static Caches createCacheOnTemp(TemporaryFolder temp) { - BootstrapSettings bootstrapSettings = new BootstrapSettings(new BootstrapProperties(Collections.emptyMap())); + BootstrapSettings bootstrapSettings = new BootstrapSettings( + new BootstrapProperties(Collections.<String,String>emptyMap()) + ); try { bootstrapSettings.properties().put(CoreProperties.WORKING_DIRECTORY, temp.newFolder().getAbsolutePath()); } catch (IOException e) { diff --git a/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionTemplateService.java b/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionTemplateService.java index 3dee4ad4a79..1a92f1ee1db 100644 --- a/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionTemplateService.java +++ b/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionTemplateService.java @@ -21,7 +21,7 @@ package org.sonar.server.permission; import com.google.common.collect.Lists; -import org.h2.util.StringUtils; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.api.ServerComponent; @@ -146,7 +146,7 @@ public class InternalPermissionTemplateService implements ServerComponent { } private void validateTemplateName(@Nullable Long templateId, String templateName) { - if (StringUtils.isNullOrEmpty(templateName)) { + if (StringUtils.isEmpty(templateName)) { String errorMsg = "Name can't be blank"; throw new BadRequestException(errorMsg); } @@ -162,7 +162,7 @@ public class InternalPermissionTemplateService implements ServerComponent { } private void validateKeyPattern(@Nullable Long templateId, @Nullable String keyPattern) { - if (StringUtils.isNullOrEmpty(keyPattern)) { + if (StringUtils.isEmpty(keyPattern)) { return; } try { diff --git a/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogServiceTest.java b/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogServiceTest.java index 2d5a2e6ef3b..18e20875ed8 100644 --- a/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogServiceTest.java +++ b/sonar-server/src/test/java/org/sonar/server/issue/IssueChangelogServiceTest.java @@ -19,7 +19,7 @@ */ package org.sonar.server.issue; -import edu.emory.mathcs.backport.java.util.Collections; +import java.util.Collections; import org.junit.Test; import org.sonar.api.issue.Issue; import org.sonar.api.issue.IssueQuery; @@ -70,7 +70,7 @@ public class IssueChangelogServiceTest { @Test public void not_load_changelog_on_unkown_issue() throws Exception { try { - IssueQueryResult issueQueryResult = new DefaultIssueQueryResult(Collections.emptyList()); + IssueQueryResult issueQueryResult = new DefaultIssueQueryResult(Collections.<Issue>emptyList()); when(issueFinder.find(any(IssueQuery.class))).thenReturn(issueQueryResult); service.changelog("ABCDE"); |