aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZipeng WU <zipeng.wu@sonarsource.com>2022-02-04 09:50:06 +0100
committersonartech <sonartech@sonarsource.com>2022-02-07 20:02:53 +0000
commitea660b1b652e86820c693f9f5a1db75d1a05a078 (patch)
tree66c955971ed9adbcba36aa806a630d864b855f36
parent287ebd22e7b582b47a17d02cd1b59470872c8ba1 (diff)
downloadsonarqube-ea660b1b652e86820c693f9f5a1db75d1a05a078.tar.gz
sonarqube-ea660b1b652e86820c693f9f5a1db75d1a05a078.zip
Fix bugs from Quality Gate
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/SpringProjectScanContainer.java2
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/SpringProjectScanContainerTest.java4
2 files changed, 4 insertions, 2 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/SpringProjectScanContainer.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/SpringProjectScanContainer.java
index d1d605f42c8..8320fa8a3fc 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/SpringProjectScanContainer.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/SpringProjectScanContainer.java
@@ -127,6 +127,7 @@ import org.sonar.scanner.sensor.ProjectSensorsExecutor;
import org.sonar.scm.git.GitScmSupport;
import org.sonar.scm.svn.SvnScmSupport;
+import static org.sonar.api.utils.Preconditions.checkNotNull;
import static org.sonar.api.batch.InstantiationStrategy.PER_BATCH;
import static org.sonar.core.extension.CoreExtensionsInstaller.noExtensionFilter;
import static org.sonar.scanner.bootstrap.ExtensionUtils.isDeprecatedScannerSide;
@@ -298,6 +299,7 @@ public class SpringProjectScanContainer extends SpringComponentContainer {
}
private void addScannerExtensions() {
+ checkNotNull(getParent());
getParent().getComponentByType(CoreExtensionsInstaller.class)
.install(this, noExtensionFilter(), extension -> getScannerProjectExtensionsFilter().accept(extension));
getParent().getComponentByType(ExtensionInstaller.class)
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/SpringProjectScanContainerTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/SpringProjectScanContainerTest.java
index 1d8ba32c327..79fc459d57f 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/SpringProjectScanContainerTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/SpringProjectScanContainerTest.java
@@ -44,7 +44,7 @@ public class SpringProjectScanContainerTest {
@ScannerSide
@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
- static class MyBatchExtension {
+ static class MyBatchExtension {
}
@@ -55,7 +55,7 @@ public class SpringProjectScanContainerTest {
}
@ServerSide
- static class MyServerExtension {
+ static class MyServerExtension {
}
}