Skip to content

Commit 52c9272

Browse files
SONARJAVA-4975 Create custom rules plugin around symbolic execution engine (#4798)
1 parent d6f74cb commit 52c9272

462 files changed

Lines changed: 17802 additions & 550 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cirrus.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ test_analyze_task:
9696
<<: *COMMON_BUILD_DEFINITION
9797
build_script:
9898
- source cirrus-env BUILD
99-
- PULL_REQUEST_SHA=$GIT_SHA1 regular_mvn_build_deploy_analyze -P-deploy-sonarsource,-release,-sign -Dmaven.deploy.skip=true -Dsonar.analysisCache.enabled=true
99+
# ignore duplications in the SE engine plugin, as it will be moved away from sonar-java at some point
100+
- PULL_REQUEST_SHA=$GIT_SHA1 regular_mvn_build_deploy_analyze -P-deploy-sonarsource,-release,-sign -Dmaven.deploy.skip=true -Dsonar.analysisCache.enabled=true -Dsonar.cpd.exclusions=java-symbolic-execution/**
100101
- ./check-license-compliance.sh
101102
cleanup_before_cache_script: cleanup_maven_repository
102103

its/autoscan/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@
8181
<version>${project.version}</version>
8282
<scope>test</scope>
8383
</dependency>
84+
<dependency>
85+
<groupId>org.sonarsource.java</groupId>
86+
<artifactId>java-symbolic-execution-plugin</artifactId>
87+
<version>${project.version}</version>
88+
<scope>test</scope>
89+
</dependency>
8490
</dependencies>
8591

8692
<profiles>

its/autoscan/src/test/java/org/sonar/java/it/AutoScanTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public class AutoScanTest {
6969
.useDefaultAdminCredentialsForBuilds(true)
7070
.setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE"))
7171
.addPlugin(FileLocation.of(TestClasspathUtils.findModuleJarPath("../../sonar-java-plugin").toFile()))
72+
.addPlugin(FileLocation.of(TestClasspathUtils.findModuleJarPath("../../java-symbolic-execution/java-symbolic-execution-plugin").toFile()))
7273
.addPlugin(MavenLocation.of("org.sonarsource.sonar-lits-plugin", "sonar-lits-plugin", "0.11.0.2659"))
7374
.build();
7475

its/plugin/tests/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@
8181
<version>${project.version}</version>
8282
<scope>test</scope>
8383
</dependency>
84+
<dependency>
85+
<groupId>org.sonarsource.java</groupId>
86+
<artifactId>java-symbolic-execution-plugin</artifactId>
87+
<version>${project.version}</version>
88+
<scope>test</scope>
89+
</dependency>
8490
<dependency>
8591
<groupId>org.sonarsource.java</groupId>
8692
<artifactId>java-custom-rules-example</artifactId>

its/plugin/tests/src/test/java/com/sonar/it/java/suite/JavaTestSuite.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public class JavaTestSuite {
6969
.useDefaultAdminCredentialsForBuilds(true)
7070
.setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE"))
7171
.addPlugin(JAVA_PLUGIN_LOCATION)
72+
.addPlugin(FileLocation.of(TestClasspathUtils.findModuleJarPath("../../../java-symbolic-execution/java-symbolic-execution-plugin").toFile()))
7273
// for support of custom rules
7374
.addPlugin(FileLocation.of(TestUtils.pluginJar("java-extension-plugin")))
7475
// making sure the tutorial is still working

its/ruling/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@
9090
<version>${project.version}</version>
9191
<scope>test</scope>
9292
</dependency>
93+
<dependency>
94+
<groupId>org.sonarsource.java</groupId>
95+
<artifactId>java-symbolic-execution-plugin</artifactId>
96+
<version>${project.version}</version>
97+
<scope>test</scope>
98+
</dependency>
9399
</dependencies>
94100

95101
<profiles>

its/ruling/src/test/java/org/sonar/java/it/JavaRulingTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ private static Orchestrator createOrchestrator() {
9898
.useDefaultAdminCredentialsForBuilds(true)
9999
.setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE"))
100100
.addPlugin(FileLocation.of(TestClasspathUtils.findModuleJarPath("../../sonar-java-plugin").toFile()))
101+
.addPlugin(FileLocation.of(TestClasspathUtils.findModuleJarPath("../../java-symbolic-execution/java-symbolic-execution-plugin").toFile()))
101102
.addPlugin(MavenLocation.of("org.sonarsource.sonar-lits-plugin", "sonar-lits-plugin", "0.11.0.2659"));
102103

103104
if (isCommunityEditionTestsOnly()) {

its/ruling/src/test/resources/commons-beanutils/java-S2259.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

java-checks/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@
4343
<artifactId>java-checks-common</artifactId>
4444
<version>${project.version}</version>
4545
</dependency>
46-
<dependency>
47-
<groupId>${project.groupId}</groupId>
48-
<artifactId>java-symbolic-execution</artifactId>
49-
<version>${project.version}</version>
50-
</dependency>
5146

5247
<dependency>
5348
<groupId>org.sonarsource.java</groupId>

java-checks/src/main/java/org/sonar/java/checks/ChangeMethodContractCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import org.sonar.plugins.java.api.tree.Tree;
3636
import org.sonar.plugins.java.api.tree.VariableTree;
3737

38-
import static org.sonar.java.se.NullabilityDataUtils.nullabilityAsString;
38+
import static org.sonar.java.checks.helpers.NullabilityDataUtils.nullabilityAsString;
3939
import static org.sonar.plugins.java.api.semantic.SymbolMetadata.NullabilityLevel.PACKAGE;
4040

4141
@Rule(key = "S2638")

0 commit comments

Comments
 (0)