]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7727 Remove some deprecated properties
authorJulien HENRY <julien.henry@sonarsource.com>
Fri, 1 Jul 2016 10:35:42 +0000 (12:35 +0200)
committerJulien HENRY <henryju@yahoo.fr>
Tue, 5 Jul 2016 12:00:16 +0000 (14:00 +0200)
it/it-plugins/project-builder-plugin/src/main/java/CreateSubProjects.java
it/it-plugins/project-builder-plugin/src/main/java/RenameProject.java
server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java
sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/bootstrap/ProjectBuilder.java
sonar-scanner-engine/src/main/java/org/sonar/batch/ProjectConfigurator.java
sonar-scanner-engine/src/test/java/org/sonar/batch/ProjectConfiguratorTest.java

index b15196f38fc3ebab6d81ab3d05d13fa981e853b7..19f74ae5a7c124db060aa790d4f4b0de831ba853 100644 (file)
@@ -31,9 +31,7 @@ public final class CreateSubProjects extends ProjectBuilder {
 
   private Settings settings;
 
-  public CreateSubProjects(ProjectReactor reactor, Settings settings) {
-    super(reactor);
-
+  public CreateSubProjects(Settings settings) {
     // A real implementation should for example use the configuration
     this.settings = settings;
   }
index de8cedfcaa79624aa881dd2bc701e9975d72ac1c..0e445973c1f6f5bc71201cc7073b62ec98b3397c 100644 (file)
@@ -1,3 +1,4 @@
+
 /*
  * SonarQube
  * Copyright (C) 2009-2016 SonarSource SA
@@ -28,9 +29,8 @@ import org.sonar.api.config.Settings;
 public final class RenameProject extends ProjectBuilder {
 
   private Settings settings;
-  
-  public RenameProject(ProjectReactor reactor, Settings settings) {
-    super(reactor);
+
+  public RenameProject(Settings settings) {
     this.settings = settings;
   }
 
index 4a3267e4ce7a7af218b7e7aedb9fc022573098f0..60cbe0676099ce37cd13a8df10db713a75c1dd8a 100644 (file)
  */
 package org.sonar.ce.container;
 
-import static java.lang.String.valueOf;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.sonar.process.ProcessEntryPoint.PROPERTY_PROCESS_INDEX;
-import static org.sonar.process.ProcessEntryPoint.PROPERTY_SHARED_PATH;
-import static org.sonar.process.ProcessProperties.PATH_DATA;
-import static org.sonar.process.ProcessProperties.PATH_HOME;
-import static org.sonar.process.ProcessProperties.PATH_TEMP;
-import static org.sonar.process.ProcessProperties.STARTED_AT;
-
 import java.io.File;
 import java.io.IOException;
 import java.util.Date;
@@ -43,6 +34,15 @@ import org.sonar.db.DbTester;
 import org.sonar.process.ProcessId;
 import org.sonar.process.Props;
 
+import static java.lang.String.valueOf;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.sonar.process.ProcessEntryPoint.PROPERTY_PROCESS_INDEX;
+import static org.sonar.process.ProcessEntryPoint.PROPERTY_SHARED_PATH;
+import static org.sonar.process.ProcessProperties.PATH_DATA;
+import static org.sonar.process.ProcessProperties.PATH_HOME;
+import static org.sonar.process.ProcessProperties.PATH_TEMP;
+import static org.sonar.process.ProcessProperties.STARTED_AT;
+
 public class ComputeEngineContainerImplTest {
   private static final int CONTAINER_ITSELF = 1;
   private static final int COMPONENTS_IN_LEVEL_1_AT_CONSTRUCTION = CONTAINER_ITSELF + 1;
@@ -102,7 +102,7 @@ public class ComputeEngineContainerImplTest {
         + 22 // level 1
         + 46 // content of DaoModule
         + 1 // content of EsSearchModule
-        + 56 // content of CorePropertyDefinitions
+        + 55 // content of CorePropertyDefinitions
         + 1 // content of CePropertyDefinitions
     );
     assertThat(picoContainer.getParent().getParent().getParent().getParent()).isNull();
index 08305b9ab159ab7b6f26db7270df1bffc32143e4..d0728366983facd1adeb6feb1b7b6ba9a26d0cdb 100644 (file)
@@ -19,8 +19,6 @@
  */
 package org.sonar.core.config;
 
-import static org.sonar.api.database.DatabaseProperties.PROP_PASSWORD;
-
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 import java.util.Arrays;
@@ -30,6 +28,8 @@ import org.sonar.api.PropertyType;
 import org.sonar.api.config.PropertyDefinition;
 import org.sonar.api.resources.Qualifiers;
 
+import static org.sonar.api.database.DatabaseProperties.PROP_PASSWORD;
+
 public class CorePropertyDefinitions {
 
   /* Time machine periods */
@@ -212,13 +212,6 @@ public class CorePropertyDefinitions {
 
       // BATCH
 
-      PropertyDefinition.builder(CoreProperties.CORE_VIOLATION_LOCALE_PROPERTY)
-        .defaultValue("en")
-        .name("Locale used for issue messages")
-        .description("Deprecated property. Keep default value for backward compatibility.")
-        .hidden()
-        .build(),
-
       PropertyDefinition.builder(TIMEMACHINE_PERIOD_PREFIX + 1)
         .name("Leak Period")
         .description("Period used to compare measures and track new issues. Values are : <ul class='bullet'><li>Number of days before " +
index 5c714dcd32074176799a3ab88c0fc09a557e1ef4..76d5ae24ca55013b7807a5edad547604e22a8f66 100644 (file)
@@ -74,40 +74,18 @@ public interface CoreProperties {
    */
   String CATEGORY_CODE_COVERAGE = "codeCoverage";
 
-  /**
-   * @see #SUBCATEGORY_DUPLICATIONS
-   * @since 2.11
-   * @deprecated since 4.0. See http://jira.sonarsource.com/browse/SONAR-4660. Do not forget to remove the properties from core bundles
-   */
-  @Deprecated
-  String CATEGORY_DUPLICATIONS = "duplications";
-
   /**
    * @since 2.11
    */
   String CATEGORY_SECURITY = "security";
 
   /**
-   * @see #SUBCATEGORY_L10N
    * @since 2.11
-   * @deprecated since 4.0. See http://jira.sonarsource.com/browse/SONAR-4660. Do not forget to remove the properties from core bundles
+   * @deprecated since 6.0
    */
   @Deprecated
-  String CATEGORY_L10N = "localization";
-
-  /**
-   * @since 2.11
-   */
   String CATEGORY_JAVA = "java";
 
-  /**
-   * @see #SUBCATEGORY_DIFFERENTIAL_VIEWS
-   * @since 2.11
-   * @deprecated since 4.0. See http://jira.sonarsource.com/browse/SONAR-4660. Do not forget to remove the properties from core bundles
-   */
-  @Deprecated
-  String CATEGORY_DIFFERENTIAL_VIEWS = "differentialViews";
-
   /**
    * @since 3.3
    */
@@ -176,12 +154,6 @@ public interface CoreProperties {
   @Deprecated
   String PROJECT_LANGUAGE_PROPERTY = "sonar.language";
 
-  /**
-   * @deprecated since 4.3. See http://jira.sonarsource.com/browse/SONAR-5185
-   */
-  @Deprecated
-  String DYNAMIC_ANALYSIS_PROPERTY = "sonar.dynamicAnalysis";
-
   /* Exclusions */
   String PROJECT_INCLUSIONS_PROPERTY = "sonar.inclusions";
   String PROJECT_EXCLUSIONS_PROPERTY = "sonar.exclusions";
@@ -199,14 +171,6 @@ public interface CoreProperties {
 
   /* Sonar Core */
 
-  /**
-   * @deprecated since 4.1. See http://jira.sonarsource.com/browse/SONAR-4875
-   */
-  @Deprecated
-  String CORE_VIOLATION_LOCALE_PROPERTY = "sonar.violationLocale";
-
-  String CORE_VIOLATION_LOCALE_DEFAULT_VALUE = "en";
-
   String CORE_FORCE_AUTHENTICATION_PROPERTY = "sonar.forceAuthentication";
   boolean CORE_FORCE_AUTHENTICATION_DEFAULT_VALUE = false;
   String CORE_ALLOW_USERS_TO_SIGNUP_PROPERTY = "sonar.allowUsersToSignUp";
@@ -371,20 +335,6 @@ public interface CoreProperties {
    */
   String PROFILING_LOG_PROPERTY = "sonar.showProfiling";
 
-  /**
-   * @deprecated replaced in v3.4 by properties specific to languages, for example sonar.java.coveragePlugin
-   * See http://jira.sonarsource.com/browse/SONARJAVA-39 for more details.
-   */
-  @Deprecated
-  String CORE_COVERAGE_PLUGIN_PROPERTY = "sonar.core.codeCoveragePlugin";
-
-  /**
-   * @since 3.7
-   * @deprecated in 4.0 no more used
-   */
-  @Deprecated
-  String DRY_RUN_READ_TIMEOUT_SEC = "sonar.dryRun.readTimeout";
-
   /**
    * @since 4.0
    * @deprecated in 5.1 no more used
index 750e782a4e90c42b4552812d913c150170714be6..62f16ab0ab8ec7b3617e084adf3610cb381a4148 100644 (file)
@@ -19,9 +19,9 @@
  */
 package org.sonar.api.batch.bootstrap;
 
-import org.sonar.api.batch.ScannerSide;
 import org.sonar.api.ExtensionPoint;
 import org.sonar.api.batch.InstantiationStrategy;
+import org.sonar.api.batch.ScannerSide;
 
 /**
  * This extension point allows to change project structure at runtime. It is executed once during task startup.
@@ -48,14 +48,6 @@ public abstract class ProjectBuilder {
     ProjectReactor projectReactor();
   }
 
-  /**
-   * Don't inject ProjectReactor as it may not be available
-   * @deprecated since 3.7 use {@link #ProjectBuilder()}
-   */
-  @Deprecated
-  protected ProjectBuilder(final ProjectReactor reactor) {
-  }
-
   /**
    * @since 3.7
    */
index 1ba176675608d53e5f829c5113bd462798a6af06..aee2aab3d71645241b47fcf28eea3d8e0d54b296 100644 (file)
@@ -57,8 +57,7 @@ public class ProjectConfigurator {
     Date analysisDate = loadAnalysisDate();
     project
       .setAnalysisDate(analysisDate)
-      .setAnalysisVersion(loadAnalysisVersion())
-      .setAnalysisType(loadAnalysisType());
+      .setAnalysisVersion(loadAnalysisVersion());
     return this;
   }
 
@@ -78,22 +77,6 @@ public class ProjectConfigurator {
     return date;
   }
 
-  private Project.AnalysisType loadAnalysisType() {
-    String value = settings.getString(CoreProperties.DYNAMIC_ANALYSIS_PROPERTY);
-    if (value == null) {
-      return Project.AnalysisType.DYNAMIC;
-    }
-
-    LOG.warn("'sonar.dynamicAnalysis' is deprecated since version 4.3 and should no longer be used.");
-    if ("true".equals(value)) {
-      return Project.AnalysisType.DYNAMIC;
-    }
-    if ("reuseReports".equals(value)) {
-      return Project.AnalysisType.REUSE_REPORTS;
-    }
-    return Project.AnalysisType.STATIC;
-  }
-
   private String loadAnalysisVersion() {
     return settings.getString(CoreProperties.PROJECT_VERSION_PROPERTY);
   }
index 6a30188454c28ca2ddc87744cd3a976cf064dc02..84b725007d8764289103cb0e0c285c1393f2a3df 100644 (file)
@@ -88,33 +88,6 @@ public class ProjectConfiguratorTest {
     assertThat(project.getAnalysisType()).isEqualTo(Project.AnalysisType.DYNAMIC);
   }
 
-  @Test
-  public void explicit_dynamic_analysis() {
-    Settings configuration = new Settings();
-    configuration.setProperty(CoreProperties.DYNAMIC_ANALYSIS_PROPERTY, "true");
-    Project project = new Project("key");
-    new ProjectConfigurator(configuration, system2).configure(project);
-    assertThat(project.getAnalysisType()).isEqualTo(Project.AnalysisType.DYNAMIC);
-  }
-
-  @Test
-  public void explicit_static_analysis() {
-    Settings configuration = new Settings();
-    configuration.setProperty(CoreProperties.DYNAMIC_ANALYSIS_PROPERTY, "false");
-    Project project = new Project("key");
-    new ProjectConfigurator(configuration, system2).configure(project);
-    assertThat(project.getAnalysisType()).isEqualTo(Project.AnalysisType.STATIC);
-  }
-
-  @Test
-  public void explicit_dynamic_analysis_reusing_reports() {
-    Settings configuration = new Settings();
-    configuration.setProperty(CoreProperties.DYNAMIC_ANALYSIS_PROPERTY, "reuseReports");
-    Project project = new Project("key");
-    new ProjectConfigurator(configuration, system2).configure(project);
-    assertThat(project.getAnalysisType()).isEqualTo(Project.AnalysisType.REUSE_REPORTS);
-  }
-
   @Test
   public void is_dynamic_analysis() {
     assertThat(Project.AnalysisType.DYNAMIC.isDynamic(false)).isTrue();