]> source.dussan.org Git - sonarqube.git/commitdiff
Fix bugs from Quality Gate
authorZipeng WU <zipeng.wu@sonarsource.com>
Fri, 4 Feb 2022 08:50:06 +0000 (09:50 +0100)
committersonartech <sonartech@sonarsource.com>
Mon, 7 Feb 2022 20:02:53 +0000 (20:02 +0000)
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/SpringProjectScanContainer.java
sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/SpringProjectScanContainerTest.java

index d1d605f42c83731fb8ee19c2946f197f0174116c..8320fa8a3fc5490b1f6d8a955ae3adff09bd580a 100644 (file)
@@ -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)
index 1d8ba32c327699264c3939d3eb1f48ce29da1533..79fc459d57fc15b8c9dac955139979a873530852 100644 (file)
@@ -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 {
 
   }
 }