diff options
Diffstat (limited to 'plugins/sonar-cpd-plugin')
3 files changed, 10 insertions, 10 deletions
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), |