aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-core
diff options
context:
space:
mode:
authorPierre <pierre.guillot@sonarsource.com>2023-07-06 16:33:40 +0200
committersonartech <sonartech@sonarsource.com>2023-07-17 20:03:45 +0000
commit30b98e2afca3a56f4b52f79f483a3b5ab353ece3 (patch)
treea60a8d3f857e22590e3265741df1174b5c86b3f7 /server/sonar-webserver-core
parent76a58bd6272c27cda372e7b0da96404501f2adcb (diff)
downloadsonarqube-30b98e2afca3a56f4b52f79f483a3b5ab353ece3.tar.gz
sonarqube-30b98e2afca3a56f4b52f79f483a3b5ab353ece3.zip
NO-JIRA replace MoreCollectors.toArrayList(size) with Collectors.toList
Diffstat (limited to 'server/sonar-webserver-core')
-rw-r--r--server/sonar-webserver-core/src/it/java/org/sonar/server/webhook/WebhookQGChangeEventListenerIT.java4
-rw-r--r--server/sonar-webserver-core/src/test/java/org/sonar/server/rule/SingleDeprecatedRuleKeyTest.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-webserver-core/src/it/java/org/sonar/server/webhook/WebhookQGChangeEventListenerIT.java b/server/sonar-webserver-core/src/it/java/org/sonar/server/webhook/WebhookQGChangeEventListenerIT.java
index 72ece76b976..37c34c09936 100644
--- a/server/sonar-webserver-core/src/it/java/org/sonar/server/webhook/WebhookQGChangeEventListenerIT.java
+++ b/server/sonar-webserver-core/src/it/java/org/sonar/server/webhook/WebhookQGChangeEventListenerIT.java
@@ -29,6 +29,7 @@ import java.util.Optional;
import java.util.Random;
import java.util.Set;
import java.util.function.Supplier;
+import java.util.stream.Collectors;
import javax.annotation.Nullable;
import org.junit.Rule;
import org.junit.Test;
@@ -63,7 +64,6 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
-import static org.sonar.core.util.stream.MoreCollectors.toArrayList;
import static org.sonar.db.component.BranchType.BRANCH;
@RunWith(DataProviderRunner.class)
@@ -239,7 +239,7 @@ public class WebhookQGChangeEventListenerIT {
.setAnalysisUuid(snapshotUuid)
.setKey(entry.getKey())
.setValue(entry.getValue()))
- .collect(toArrayList(properties.size()));
+ .collect(Collectors.toList());
dbTester.getDbClient().analysisPropertiesDao().insert(dbTester.getSession(), analysisProperties);
dbTester.getSession().commit();
}
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/SingleDeprecatedRuleKeyTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/SingleDeprecatedRuleKeyTest.java
index d5a4b3b528c..c429d743a11 100644
--- a/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/SingleDeprecatedRuleKeyTest.java
+++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/rule/SingleDeprecatedRuleKeyTest.java
@@ -21,11 +21,11 @@ package org.sonar.server.rule;
import com.google.common.collect.ImmutableSet;
import java.util.Set;
+import java.util.stream.Collectors;
import org.assertj.core.groups.Tuple;
import org.junit.Test;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.server.rule.RulesDefinition;
-import org.sonar.core.util.stream.MoreCollectors;
import org.sonar.db.rule.DeprecatedRuleKeyDto;
import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
@@ -81,7 +81,7 @@ public class SingleDeprecatedRuleKeyTest {
.containsExactlyInAnyOrder(
deprecatedRuleKeys.stream().map(
r -> tuple(null, r.repository(), r.rule(), rule.repository().key(), rule.key(), RuleKey.of(r.repository(), r.rule())))
- .collect(MoreCollectors.toArrayList(deprecatedRuleKeys.size())).toArray(new Tuple[deprecatedRuleKeys.size()]));
+ .collect(Collectors.toList()).toArray(new Tuple[deprecatedRuleKeys.size()]));
}
@Test