diff --git a/pom.xml b/pom.xml
index 8013d5b8ef5..96ff541ce58 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,7 +62,6 @@
10.6.0.92116
17
${jdk.min.version}
- 33.2.1-jre
9.14.0.375
@@ -139,12 +138,6 @@
5.12.0
test
-
- com.google.guava
- guava
- ${guava.version}
- test
-
org.codehaus.woodstox
stax2-api
diff --git a/sonar-csharp-plugin/pom.xml b/sonar-csharp-plugin/pom.xml
index 558100165fa..1d35557fe3e 100644
--- a/sonar-csharp-plugin/pom.xml
+++ b/sonar-csharp-plugin/pom.xml
@@ -90,10 +90,6 @@
org.mockito
mockito-core
-
- com.google.guava
- guava
-
org.codehaus.woodstox
stax2-api
diff --git a/sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpPluginTest.java b/sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpPluginTest.java
index e2372fcc504..ccb6652c91f 100644
--- a/sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpPluginTest.java
+++ b/sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpPluginTest.java
@@ -19,15 +19,11 @@
*/
package org.sonar.plugins.csharp;
-import com.google.common.collect.ImmutableList;
-import java.util.List;
-
import org.junit.jupiter.api.Test;
import org.sonar.api.Plugin;
import org.sonar.api.SonarEdition;
import org.sonar.api.SonarQubeSide;
import org.sonar.api.SonarRuntime;
-import org.sonar.api.config.PropertyDefinition;
import org.sonar.api.internal.SonarRuntimeImpl;
import org.sonar.api.utils.Version;
import org.sonarsource.dotnet.shared.plugins.AnalysisWarningsSensor;
@@ -49,6 +45,7 @@
import org.sonarsource.dotnet.shared.plugins.WrongEncodingFileFilter;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.sonarsource.dotnet.shared.PropertyUtils.nonProperties;
class CSharpPluginTest {
@@ -97,14 +94,4 @@ void getExtensions() {
+ new CSharpPropertyDefinitions(sonarRuntime).create().size());
}
- private static List nonProperties(List extensions) {
- ImmutableList.Builder builder = ImmutableList.builder();
- for (Object extension : extensions) {
- if (!(extension instanceof PropertyDefinition)) {
- builder.add(extension);
- }
- }
- return builder.build();
- }
-
}
diff --git a/sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpSonarWayProfileTest.java b/sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpSonarWayProfileTest.java
index 06d70390f4f..69deef901b9 100644
--- a/sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpSonarWayProfileTest.java
+++ b/sonar-csharp-plugin/src/test/java/org/sonar/plugins/csharp/CSharpSonarWayProfileTest.java
@@ -19,11 +19,11 @@
*/
package org.sonar.plugins.csharp;
-import com.google.common.collect.Sets;
import com.sonar.plugins.security.api.CsRules;
import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.HashSet;
+import java.util.Set;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -57,7 +57,7 @@ void sonar_security_with_already_activated_rule() {
Mockito.when(profile.activateRule(CSharpPlugin.REPOSITORY_KEY, "TEST")).thenThrow(IllegalArgumentException.class);
Context context = Mockito.mock(Context.class);
Mockito.when(context.createBuiltInQualityProfile(anyString(), anyString())).thenReturn(profile);
- CsRules.ruleKeys = Sets.newHashSet("TEST");
+ CsRules.ruleKeys = Set.of("TEST");
CSharpSonarWayProfile profileDef = new CSharpSonarWayProfile();
profileDef.define(context);
@@ -73,7 +73,7 @@ void sonar_security_with_unknown_rule_repository() {
Mockito.when(profile.activateRule("roslyn.TEST", "TEST")).thenThrow(IllegalStateException.class);
Context context = Mockito.mock(Context.class);
Mockito.when(context.createBuiltInQualityProfile(anyString(), anyString())).thenReturn(profile);
- CsRules.ruleKeys = Sets.newHashSet("TEST");
+ CsRules.ruleKeys = Set.of("TEST");
CsRules.returnRepository = true;
CSharpSonarWayProfile profileDef = new CSharpSonarWayProfile();
@@ -85,7 +85,7 @@ void sonar_security_with_unknown_rule_repository() {
@Test
void sonar_security_with_custom_frontend_plugin() {
Context context = new Context();
- CsRules.ruleKeys = Sets.newHashSet("S3649");
+ CsRules.ruleKeys = Set.of("S3649");
CsRules.returnRepository = true;
CSharpSonarWayProfile profileDef = new CSharpSonarWayProfile();
@@ -102,7 +102,7 @@ void sonar_security_with_duplicated_quality_profile_name() {
NewBuiltInQualityProfile sonarWay = context.createBuiltInQualityProfile("Sonar way", CSharpPlugin.LANGUAGE_KEY);
sonarWay.activateRule(CSharpPlugin.REPOSITORY_KEY, "S1");
sonarWay.done();
- CsRules.ruleKeys = Sets.newHashSet("S2");
+ CsRules.ruleKeys = Set.of("S2");
CSharpSonarWayProfile profileDef = new CSharpSonarWayProfile();
@@ -126,7 +126,7 @@ void sonar_security_missing() {
@Test
void sonar_security_7_3_present() {
Context context = new Context();
- CsRules.ruleKeys = Sets.newHashSet("S3649");
+ CsRules.ruleKeys = Set.of("S3649");
CsRules.returnRepository = false;
CSharpSonarWayProfile profileDef = new CSharpSonarWayProfile();
diff --git a/sonar-dotnet-shared-library/pom.xml b/sonar-dotnet-shared-library/pom.xml
index 0fd0748c201..8ce9ca9e0e3 100644
--- a/sonar-dotnet-shared-library/pom.xml
+++ b/sonar-dotnet-shared-library/pom.xml
@@ -83,10 +83,6 @@
org.mockito
mockito-core
-
- com.google.guava
- guava
-
org.sonarsource.sonarqube
sonar-plugin-api-impl
diff --git a/sonar-dotnet-shared-library/src/main/java/org/sonarsource/dotnet/shared/PropertyUtils.java b/sonar-dotnet-shared-library/src/main/java/org/sonarsource/dotnet/shared/PropertyUtils.java
new file mode 100644
index 00000000000..5ee7f1a9cf2
--- /dev/null
+++ b/sonar-dotnet-shared-library/src/main/java/org/sonarsource/dotnet/shared/PropertyUtils.java
@@ -0,0 +1,44 @@
+/*
+ * SonarSource :: .NET :: Shared library
+ * Copyright (C) 2014-2024 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.sonarsource.dotnet.shared;
+
+import org.sonar.api.config.PropertyDefinition;
+
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class PropertyUtils {
+ private PropertyUtils() { }
+
+ public static Set
-
- com.google.guava
- guava
-
org.codehaus.woodstox
stax2-api
diff --git a/sonar-vbnet-plugin/src/test/java/org/sonar/plugins/vbnet/VbNetPluginTest.java b/sonar-vbnet-plugin/src/test/java/org/sonar/plugins/vbnet/VbNetPluginTest.java
index 6a2fe3300e5..9f41e522c6f 100644
--- a/sonar-vbnet-plugin/src/test/java/org/sonar/plugins/vbnet/VbNetPluginTest.java
+++ b/sonar-vbnet-plugin/src/test/java/org/sonar/plugins/vbnet/VbNetPluginTest.java
@@ -19,7 +19,6 @@
*/
package org.sonar.plugins.vbnet;
-import com.google.common.collect.ImmutableList;
import java.util.List;
import org.junit.jupiter.api.Test;
@@ -27,7 +26,6 @@
import org.sonar.api.SonarEdition;
import org.sonar.api.SonarQubeSide;
import org.sonar.api.SonarRuntime;
-import org.sonar.api.config.PropertyDefinition;
import org.sonar.api.internal.SonarRuntimeImpl;
import org.sonar.api.utils.Version;
import org.sonarsource.dotnet.shared.plugins.CodeCoverageProvider;
@@ -48,6 +46,7 @@
import org.sonarsource.dotnet.shared.plugins.WrongEncodingFileFilter;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.sonarsource.dotnet.shared.PropertyUtils.nonProperties;
class VbNetPluginTest {
@@ -95,14 +94,4 @@ void getExtensions() {
+ new VbNetPropertyDefinitions(sonarRuntime).create().size());
}
- private static List nonProperties(List extensions) {
- ImmutableList.Builder builder = ImmutableList.builder();
- for (Object extension : extensions) {
- if (!(extension instanceof PropertyDefinition)) {
- builder.add(extension);
- }
- }
- return builder.build();
- }
-
}