aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-deprecated
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-01-28 22:41:25 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2015-02-10 17:16:01 +0100
commite9b5effe30cf68820a3dfb00bf736a325313206b (patch)
tree74323c9b304a2b5f76d2f77ca6c4b86d03fa4296 /sonar-deprecated
parent46b6c6f692964e6202aa269245e579badb856e94 (diff)
downloadsonarqube-e9b5effe30cf68820a3dfb00bf736a325313206b.tar.gz
sonarqube-e9b5effe30cf68820a3dfb00bf736a325313206b.zip
SONAR-6134, SONAR-6048 Improve performance of FS indexation
Diffstat (limited to 'sonar-deprecated')
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractSourceImporter.java10
-rw-r--r--sonar-deprecated/src/test/java/org/sonar/api/checks/NoSonarFilterTest.java6
2 files changed, 4 insertions, 12 deletions
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractSourceImporter.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractSourceImporter.java
index f453c1e6579..137437fae4f 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractSourceImporter.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractSourceImporter.java
@@ -22,7 +22,6 @@ package org.sonar.api.batch;
import org.sonar.api.resources.Language;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.ProjectFileSystem;
-import org.sonar.api.resources.Qualifiers;
import org.sonar.api.resources.Resource;
import java.io.File;
@@ -66,14 +65,7 @@ public abstract class AbstractSourceImporter implements Sensor {
}
protected Resource createResource(File file, List<File> sourceDirs, boolean unitTest) {
- org.sonar.api.resources.File resource = org.sonar.api.resources.File.fromIOFile(file, sourceDirs);
- if (resource != null) {
- resource.setLanguage(language);
- if (unitTest) {
- resource.setQualifier(Qualifiers.UNIT_TEST_FILE);
- }
- }
- return resource;
+ return null;
}
protected boolean isEnabled(Project project) {
diff --git a/sonar-deprecated/src/test/java/org/sonar/api/checks/NoSonarFilterTest.java b/sonar-deprecated/src/test/java/org/sonar/api/checks/NoSonarFilterTest.java
index 1521ca67b52..4cc3bda8872 100644
--- a/sonar-deprecated/src/test/java/org/sonar/api/checks/NoSonarFilterTest.java
+++ b/sonar-deprecated/src/test/java/org/sonar/api/checks/NoSonarFilterTest.java
@@ -45,8 +45,8 @@ public class NoSonarFilterTest {
@Before
public void prepare() {
when(chain.accept(isA(Issue.class))).thenReturn(true);
- javaFile = new File("org.foo.Bar");
- javaFile.setEffectiveKey("struts:org.apache.Action");
+ javaFile = File.create("org/foo/Bar.java");
+ javaFile.setEffectiveKey("struts:org/foo/Bar.java");
when(sonarIndex.getResource(javaFile)).thenReturn(javaFile);
}
@@ -58,7 +58,7 @@ public class NoSonarFilterTest {
filter.addResource(javaFile, noSonarLines);
Issue issue = mock(Issue.class);
- when(issue.componentKey()).thenReturn("struts:org.apache.Action");
+ when(issue.componentKey()).thenReturn("struts:org/foo/Bar.java");
when(issue.ruleKey()).thenReturn(RuleKey.of("squid", "Foo"));
// violation on class