]> source.dussan.org Git - sonarqube.git/commitdiff
lower complexity of searchTests method
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 8 May 2015 08:23:16 +0000 (10:23 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 8 May 2015 08:23:16 +0000 (10:23 +0200)
server/sonar-server/src/main/java/org/sonar/server/test/ws/TestsListAction.java

index 95cff159b71456e06cc1ae83fe02b93634505336..ffd502d92a4facbd5235153b56e173e7d4b4c3a9 100644 (file)
@@ -182,16 +182,20 @@ public class TestsListAction implements TestAction {
     @Nullable String sourceFileUuid, @Nullable Integer sourceFileLineNumber, SearchOptions searchOptions) {
     if (testUuid != null) {
       return searchTestsByTestUuid(dbSession, testUuid, searchOptions);
-    } else if (testFileUuid != null) {
+    }
+    if (testFileUuid != null) {
       return searchTestsByTestFileUuid(dbSession, testFileUuid, searchOptions);
-    } else if (testFileKey != null) {
+    }
+    if (testFileKey != null) {
       return searchTestsByTestFileKey(dbSession, testFileKey, searchOptions);
-    } else if (sourceFileUuid != null && sourceFileLineNumber != null) {
+    }
+    if (sourceFileUuid != null && sourceFileLineNumber != null) {
       return searchTestsBySourceFileUuidAndLineNumber(dbSession, sourceFileUuid, sourceFileLineNumber, searchOptions);
     }
 
     throw new IllegalArgumentException(
-      "One (and only one) of the following combination of parameters must be provided: 1) test UUID. 2) test file UUID. 3) test file key. 4) source file UUID and source file line number.");
+      "One (and only one) of the following combination of parameters must be provided: 1) test UUID. 2) test file UUID. " +
+        "3) test file key. 4) source file UUID and source file line number.");
   }
 
   private SearchResult<TestDoc> searchTestsBySourceFileUuidAndLineNumber(DbSession dbSession, String sourceFileUuid, Integer sourceFileLineNumber, SearchOptions searchOptions) {