diff options
Diffstat (limited to 'plugins')
6 files changed, 36 insertions, 36 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/UserManagedMetrics.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/UserManagedMetrics.java index cf5996477f6..1bc1d597a6b 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/UserManagedMetrics.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/UserManagedMetrics.java @@ -29,24 +29,24 @@ public final class UserManagedMetrics implements Metrics { private static final String DOMAIN = "Management"; public List<Metric> getMetrics() { - return ImmutableList.of( - new Metric.Builder("burned_budget", "Burned budget", Metric.ValueType.FLOAT) - .setDirection(Metric.DIRECTION_NONE) - .setQualitative(false) - .setDomain(DOMAIN) - .setUserManaged(true) - .create(), - new Metric.Builder("business_value", "Business value", Metric.ValueType.FLOAT) - .setDirection(Metric.DIRECTION_BETTER) - .setQualitative(true) - .setDomain(DOMAIN) - .setUserManaged(true) - .create(), - new Metric.Builder("team_size", "Team size", Metric.ValueType.INT) - .setDirection(Metric.DIRECTION_NONE) - .setQualitative(false) - .setDomain(DOMAIN) - .setUserManaged(true) - .create()); + return ImmutableList.<Metric>of( + new Metric.Builder("burned_budget", "Burned budget", Metric.ValueType.FLOAT) + .setDirection(Metric.DIRECTION_NONE) + .setQualitative(false) + .setDomain(DOMAIN) + .setUserManaged(true) + .create(), + new Metric.Builder("business_value", "Business value", Metric.ValueType.FLOAT) + .setDirection(Metric.DIRECTION_BETTER) + .setQualitative(true) + .setDomain(DOMAIN) + .setUserManaged(true) + .create(), + new Metric.Builder("team_size", "Team size", Metric.ValueType.INT) + .setDirection(Metric.DIRECTION_NONE) + .setQualitative(false) + .setDomain(DOMAIN) + .setUserManaged(true) + .create()); } } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/FileHashSensor.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/FileHashSensor.java index 3e758761c18..b1c5dac5147 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/FileHashSensor.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/FileHashSensor.java @@ -23,7 +23,7 @@ import com.google.common.collect.Maps; import org.sonar.api.batch.Sensor; import org.sonar.api.batch.SensorContext; import org.sonar.api.batch.fs.InputFile; -import org.sonar.api.batch.fs.internal.DefaultInputFile; +import org.sonar.api.batch.fs.internal.DeprecatedDefaultInputFile; import org.sonar.api.resources.Project; import org.sonar.api.utils.KeyValueFormat; import org.sonar.batch.index.ComponentDataCache; @@ -59,7 +59,7 @@ public final class FileHashSensor implements Sensor { public void analyse(Project project, SensorContext context) { Map<String, String> map = Maps.newHashMap(); for (InputFile inputFile : fileCache.byModule(project.key())) { - String hash = ((DefaultInputFile) inputFile).hash(); + String hash = ((DeprecatedDefaultInputFile) inputFile).hash(); if (hash != null) { map.put(inputFile.relativePath(), hash); } diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/FileHashSensorTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/FileHashSensorTest.java index 4db5159ed48..29f5e64cce9 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/FileHashSensorTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/sensors/FileHashSensorTest.java @@ -28,7 +28,7 @@ import org.junit.rules.ExpectedException; import org.junit.rules.TemporaryFolder; import org.sonar.api.batch.SensorContext; import org.sonar.api.batch.fs.InputFile; -import org.sonar.api.batch.fs.internal.DefaultInputFile; +import org.sonar.api.batch.fs.internal.DeprecatedDefaultInputFile; import org.sonar.api.resources.Project; import org.sonar.batch.index.ComponentDataCache; import org.sonar.batch.scan.filesystem.InputFileCache; @@ -58,8 +58,8 @@ public class FileHashSensorTest { @Test public void store_file_hashes() throws Exception { when(fileCache.byModule("struts")).thenReturn(Lists.<InputFile>newArrayList( - new DefaultInputFile("src/Foo.java").setFile(temp.newFile()).setHash("ABC"), - new DefaultInputFile("src/Bar.java").setFile(temp.newFile()).setHash("DEF"))); + new DeprecatedDefaultInputFile("src/Foo.java").setFile(temp.newFile()).setHash("ABC"), + new DeprecatedDefaultInputFile("src/Bar.java").setFile(temp.newFile()).setHash("DEF"))); SensorContext sensorContext = mock(SensorContext.class); sensor.analyse(project, sensorContext); @@ -72,8 +72,8 @@ public class FileHashSensorTest { public void store_file_hashes_for_branches() throws Exception { project = new Project("struts", "branch-2.x", "Struts 2.x"); when(fileCache.byModule("struts:branch-2.x")).thenReturn(Lists.<InputFile>newArrayList( - new DefaultInputFile("src/Foo.java").setFile(temp.newFile()).setHash("ABC"), - new DefaultInputFile("src/Bar.java").setFile(temp.newFile()).setHash("DEF"))); + new DeprecatedDefaultInputFile("src/Foo.java").setFile(temp.newFile()).setHash("ABC"), + new DeprecatedDefaultInputFile("src/Bar.java").setFile(temp.newFile()).setHash("DEF"))); SensorContext sensorContext = mock(SensorContext.class); sensor.analyse(project, sensorContext); diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarBridgeEngine.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarBridgeEngine.java index 7c24a89bb3a..df4bc036115 100644 --- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarBridgeEngine.java +++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarBridgeEngine.java @@ -31,7 +31,7 @@ import org.sonar.api.batch.SensorContext; import org.sonar.api.batch.fs.FilePredicates; import org.sonar.api.batch.fs.FileSystem; import org.sonar.api.batch.fs.InputFile; -import org.sonar.api.batch.fs.internal.DefaultInputFile; +import org.sonar.api.batch.fs.internal.DeprecatedDefaultInputFile; import org.sonar.api.config.Settings; import org.sonar.api.resources.Project; import org.sonar.api.utils.SonarException; @@ -106,7 +106,7 @@ public class SonarBridgeEngine extends CpdEngine { TokenizerBridge bridge = new TokenizerBridge(mapping.getTokenizer(), fs.encoding().name(), getBlockSize(project, languageKey)); for (InputFile inputFile : sourceFiles) { LOG.debug("Populating index from {}", inputFile); - String resourceEffectiveKey = ((DefaultInputFile) inputFile).key(); + String resourceEffectiveKey = ((DeprecatedDefaultInputFile) inputFile).key(); List<Block> blocks = bridge.chunk(resourceEffectiveKey, inputFile.file()); index.insert(inputFile, blocks); } @@ -118,7 +118,7 @@ public class SonarBridgeEngine extends CpdEngine { try { for (InputFile inputFile : sourceFiles) { LOG.debug("Detection of duplications for {}", inputFile); - String resourceEffectiveKey = ((DefaultInputFile) inputFile).key(); + String resourceEffectiveKey = ((DeprecatedDefaultInputFile) inputFile).key(); Collection<Block> fileBlocks = index.getByInputFile(inputFile, resourceEffectiveKey); Iterable<CloneGroup> filtered; diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java index 8255053db31..130206427fc 100644 --- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java +++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java @@ -31,7 +31,7 @@ import org.sonar.api.batch.SensorContext; import org.sonar.api.batch.fs.FilePredicates; import org.sonar.api.batch.fs.FileSystem; import org.sonar.api.batch.fs.InputFile; -import org.sonar.api.batch.fs.internal.DefaultInputFile; +import org.sonar.api.batch.fs.internal.DeprecatedDefaultInputFile; import org.sonar.api.config.Settings; import org.sonar.api.measures.CoreMetrics; import org.sonar.api.measures.Measure; @@ -115,7 +115,7 @@ public class SonarEngine extends CpdEngine { for (InputFile inputFile : sourceFiles) { LOG.debug("Populating index from {}", inputFile); - String resourceEffectiveKey = ((DefaultInputFile) inputFile).key(); + String resourceEffectiveKey = ((DeprecatedDefaultInputFile) inputFile).key(); List<Statement> statements; @@ -141,7 +141,7 @@ public class SonarEngine extends CpdEngine { try { for (InputFile inputFile : sourceFiles) { LOG.debug("Detection of duplications for {}", inputFile); - String resourceEffectiveKey = ((DefaultInputFile) inputFile).key(); + String resourceEffectiveKey = ((DeprecatedDefaultInputFile) inputFile).key(); Collection<Block> fileBlocks = index.getByInputFile(inputFile, resourceEffectiveKey); diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarEngineTest.java b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarEngineTest.java index ac2be64ac60..c8551a74166 100644 --- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarEngineTest.java +++ b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/SonarEngineTest.java @@ -25,7 +25,7 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.sonar.api.batch.SensorContext; import org.sonar.api.batch.fs.InputFile; -import org.sonar.api.batch.fs.internal.DefaultInputFile; +import org.sonar.api.batch.fs.internal.DeprecatedDefaultInputFile; import org.sonar.api.measures.CoreMetrics; import org.sonar.api.test.IsMeasure; import org.sonar.duplications.index.CloneGroup; @@ -46,11 +46,11 @@ public class SonarEngineTest { public TemporaryFolder temp = new TemporaryFolder(); SensorContext context = mock(SensorContext.class); - DefaultInputFile inputFile; + DeprecatedDefaultInputFile inputFile; @Before public void before() throws IOException { - inputFile = new DefaultInputFile("src/main/java/Foo.java"); + inputFile = new DeprecatedDefaultInputFile("src/main/java/Foo.java"); inputFile.setFile(temp.newFile("Foo.java")); } @@ -138,7 +138,7 @@ public class SonarEngineTest { @Test public void shouldEscapeXmlEntities() throws IOException { - InputFile csharpFile = new DefaultInputFile("Loads/File Loads/Subs & Reds/SubsRedsDelivery.cs") + InputFile csharpFile = new DeprecatedDefaultInputFile("Loads/File Loads/Subs & Reds/SubsRedsDelivery.cs") .setFile(temp.newFile("SubsRedsDelivery.cs")); List<CloneGroup> groups = Arrays.asList(newCloneGroup( new ClonePart("Loads/File Loads/Subs & Reds/SubsRedsDelivery.cs", 0, 5, 204), |