]> source.dussan.org Git - sonarqube.git/commitdiff
Fix compatibility with plugins that execute fs#addSourceDir()
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 14 Oct 2013 16:29:37 +0000 (18:29 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 14 Oct 2013 16:29:59 +0000 (18:29 +0200)
sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/DefaultModuleFileSystem.java
sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ProjectFileSystemAdapter.java

index f37c3021b6619d948e096f267345427faba07ea3..28c89ce60dadbb2aa732118864c64f94162c7d11 100644 (file)
@@ -123,6 +123,24 @@ public class DefaultModuleFileSystem implements ModuleFileSystem, Startable {
     return testFiles;
   }
 
+  /**
+   * Should not be used - only for old plugins
+   */
+  @Deprecated
+  void addSourceDir(File dir) {
+    sourceDirs.add(dir);
+    index();
+  }
+
+  /**
+   * Should not be used - only for old plugins
+   */
+  @Deprecated
+  void addTestDir(File dir) {
+    testDirs.add(dir);
+    index();
+  }
+
   @Override
   public Charset sourceCharset() {
     final Charset charset;
index 2f3ab0c46314f18993c81f396a1c04d879b8e606..1f5ab333658b770df6b02cd750a27a00797b12dd 100644 (file)
@@ -96,7 +96,8 @@ public class ProjectFileSystemAdapter implements ProjectFileSystem {
   }
 
   public ProjectFileSystem addSourceDir(File dir) {
-    throw new UnsupportedOperationException("Unsupported since 4.0");
+    target.addSourceDir(dir);
+    return this;
   }
 
   public List<File> getTestDirs() {
@@ -104,7 +105,8 @@ public class ProjectFileSystemAdapter implements ProjectFileSystem {
   }
 
   public ProjectFileSystem addTestDir(File dir) {
-    throw new UnsupportedOperationException("Unsupported since 4.0");
+    target.addTestDir(dir);
+    return this;
   }
 
   public File getReportOutputDir() {