* @since 4.3
* @deprecated since 6.5 debt model will soon be unavailable on batch side
*/
+@Deprecated
public class DebtRemediationFunction {
public enum Type {
/**
* @deprecated since 6.5 use {@link PostJobContext#config()}
*/
+ @Deprecated
Settings settings();
/**
import org.sonar.api.batch.sensor.measure.Measure;
import org.sonar.api.batch.sensor.measure.NewMeasure;
import org.sonar.api.batch.sensor.symbol.NewSymbolTable;
-import org.sonar.api.config.Settings;
import org.sonar.api.config.Configuration;
+import org.sonar.api.config.Settings;
import org.sonar.api.utils.Version;
/**
/**
* @deprecated since 6.5 use {@link PostJobContext#config()}
*/
+ @Deprecated
Settings settings();
/**
private final DefaultIndex index;
private final InputModule module;
- public DeprecatedSensorContext(InputModule module, DefaultIndex index, Configuration config, org.sonar.api.config.Settings mutableSettings, FileSystem fs, ActiveRules activeRules,
+ public DeprecatedSensorContext(InputModule module, DefaultIndex index, Configuration config, org.sonar.api.config.Settings mutableSettings,
+ FileSystem fs, ActiveRules activeRules,
AnalysisMode analysisMode, SensorStorage sensorStorage, SonarRuntime sonarRuntime) {
super(module, config, mutableSettings, fs, activeRules, analysisMode, sensorStorage, sonarRuntime);
this.index = index;
return projectSettings;
}
- private Map<String, String> addServerSidePropertiesIfModuleExists(ProjectRepositories projectRepos, ProjectDefinition def) {
+ private static Map<String, String> addServerSidePropertiesIfModuleExists(ProjectRepositories projectRepos, ProjectDefinition def) {
if (projectRepos.moduleExists(def.getKeyWithBranch())) {
return projectRepos.settings(def.getKeyWithBranch());
} else {
}
}
- private void addScannerSideProperties(Map<String, String> settings, ProjectDefinition project) {
+ private static void addScannerSideProperties(Map<String, String> settings, ProjectDefinition project) {
List<ProjectDefinition> orderedProjects = getTopDownParentProjects(project);
for (ProjectDefinition p : orderedProjects) {
settings.putAll(p.properties());
*/
package org.sonar.scanner.scan;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
}
private void addBuildProperties(ProjectDefinition project) {
- List<ProjectDefinition> orderedProjects = getTopDownParentProjects(project);
+ List<ProjectDefinition> orderedProjects = ModuleSettingsProvider.getTopDownParentProjects(project);
for (ProjectDefinition p : orderedProjects) {
addProperties(p.properties());
}
}
- /**
- * From root to given project
- */
- static List<ProjectDefinition> getTopDownParentProjects(ProjectDefinition project) {
- List<ProjectDefinition> result = new ArrayList<>();
- ProjectDefinition p = project;
- while (p != null) {
- result.add(0, p);
- p = p.getParent();
- }
- return result;
- }
-
@Override
protected Optional<String> get(String key) {
if (analysisMode.isIssues() && key.endsWith(".secured") && !key.contains(".license")) {
grandParent.addSubProject(parent);
parent.addSubProject(child);
- List<ProjectDefinition> hierarchy = MutableModuleSettings.getTopDownParentProjects(child);
+ List<ProjectDefinition> hierarchy = ModuleSettingsProvider.getTopDownParentProjects(child);
assertThat(hierarchy.get(0)).isEqualTo(grandParent);
assertThat(hierarchy.get(1)).isEqualTo(parent);
assertThat(hierarchy.get(2)).isEqualTo(child);