From 36baed9b0bc9e1318ae1355b309910e85a6542ed Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Fri, 8 May 2015 10:23:16 +0200 Subject: [PATCH] lower complexity of searchTests method --- .../org/sonar/server/test/ws/TestsListAction.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/test/ws/TestsListAction.java b/server/sonar-server/src/main/java/org/sonar/server/test/ws/TestsListAction.java index 95cff159b71..ffd502d92a4 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/test/ws/TestsListAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/test/ws/TestsListAction.java @@ -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 searchTestsBySourceFileUuidAndLineNumber(DbSession dbSession, String sourceFileUuid, Integer sourceFileLineNumber, SearchOptions searchOptions) { -- 2.39.5