]> source.dussan.org Git - sonarqube.git/commitdiff
Fix some quality flaws
authorJulien HENRY <julien.henry@sonarsource.com>
Thu, 21 May 2015 14:31:22 +0000 (16:31 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Fri, 22 May 2015 07:12:09 +0000 (09:12 +0200)
sonar-batch/src/main/java/org/sonar/batch/deprecated/perspectives/BatchPerspectives.java
sonar-batch/src/main/java/org/sonar/batch/test/DefaultTestCase.java

index 47124c44c29ad670093f767aca201d5b96c6308d..a39e2383f25a390cba293ed58aa4d914d233034c 100644 (file)
@@ -23,13 +23,9 @@ import com.google.common.collect.Maps;
 import java.util.Map;
 import javax.annotation.CheckForNull;
 import org.sonar.api.batch.SonarIndex;
-import org.sonar.api.batch.fs.InputDir;
-import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.InputPath;
 import org.sonar.api.component.Perspective;
 import org.sonar.api.component.ResourcePerspectives;
-import org.sonar.api.resources.Directory;
-import org.sonar.api.resources.File;
 import org.sonar.api.resources.Resource;
 import org.sonar.batch.index.BatchComponentCache;
 
@@ -63,14 +59,6 @@ public class BatchPerspectives implements ResourcePerspectives {
 
   @Override
   public <P extends Perspective> P as(Class<P> perspectiveClass, InputPath inputPath) {
-    Resource r;
-    if (inputPath instanceof InputDir) {
-      r = Directory.create(((InputDir) inputPath).relativePath());
-    } else if (inputPath instanceof InputFile) {
-      r = File.create(((InputFile) inputPath).relativePath());
-    } else {
-      throw new IllegalArgumentException("Unknow input path type: " + inputPath);
-    }
     PerspectiveBuilder<P> builder = builderFor(perspectiveClass);
     return builder.loadPerspective(perspectiveClass, componentCache.get(inputPath));
   }
index 6cf1af728da65b5dedbe5b11eb329530f4b6915f..0c692e17a907ee7905ca5bcb5ce717ed1232139c 100644 (file)
@@ -82,7 +82,6 @@ public class DefaultTestCase implements MutableTestCase {
   @Override
   public MutableTestCase setStatus(@Nullable Status s) {
     this.status = s;
-    ;
     return this;
   }