diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-01-26 20:59:13 +0300 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-01-27 19:40:21 +0300 |
commit | c2f90c84e3fef821bfdee686351375a2732ac06e (patch) | |
tree | eb1e15d58e70136744a7d5d59844e4a2639aec50 /plugins | |
parent | 815899837ca07904fe9dc9223b4a4e8ac486cb59 (diff) | |
download | sonarqube-c2f90c84e3fef821bfdee686351375a2732ac06e.tar.gz sonarqube-c2f90c84e3fef821bfdee686351375a2732ac06e.zip |
SONAR-2126: Change API to work with file system of a project
* Use language keys instead of objects.
* ProjectFileSystem now BatchComponent, so DefaultProjectFileSystem
uses benefits from injections and some old code was removed from
it to improve immutability.
* Small performance improvement for DefaultInputFile.
Diffstat (limited to 'plugins')
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/JavaSourceImporter.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/JavaSourceImporter.java index 0e7a1c1e3f4..23bcd777f59 100644 --- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/JavaSourceImporter.java +++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/JavaSourceImporter.java @@ -50,8 +50,8 @@ public final class JavaSourceImporter implements Sensor { } void analyse(ProjectFileSystem fileSystem, SensorContext context) { - parseDirs(context, fileSystem.mainFiles(Java.INSTANCE), false, fileSystem.getSourceCharset()); - parseDirs(context, fileSystem.testFiles(Java.INSTANCE), true, fileSystem.getSourceCharset()); + parseDirs(context, fileSystem.mainFiles(Java.KEY), false, fileSystem.getSourceCharset()); + parseDirs(context, fileSystem.testFiles(Java.KEY), true, fileSystem.getSourceCharset()); } void parseDirs(SensorContext context, List<InputFile> inputFiles, boolean unitTest, Charset sourcesEncoding) { diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidSensor.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidSensor.java index c79a60d2559..56245cd153b 100644 --- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidSensor.java +++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidSensor.java @@ -83,7 +83,7 @@ public class SquidSensor implements Sensor { } private void browseTestSources(Project project, SensorContext context) { - for (InputFile testFile : project.getFileSystem().testFiles(Java.INSTANCE)) { + for (InputFile testFile : project.getFileSystem().testFiles(Java.KEY)) { context.index(JavaFile.fromRelativePath(testFile.getRelativePath(), true)); } } |