summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-09-08 13:50:01 +0200
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-09-17 09:30:51 +0200
commitbac72033230c2ea0d1a99434376ae04ca05cf00e (patch)
treea1ce4f7ec15beb50cb7c6ecbaaad7c0ef2154ff7 /server
parent0128f7fd9066e4a4d6b35f592f7ef2f9c84260dc (diff)
downloadsonarqube-bac72033230c2ea0d1a99434376ae04ca05cf00e.tar.gz
sonarqube-bac72033230c2ea0d1a99434376ae04ca05cf00e.zip
Small refactoring on qprofiles/search WS and ProjectRepositoryLoader
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/batch/ProjectRepositoryLoader.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java10
2 files changed, 2 insertions, 10 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/batch/ProjectRepositoryLoader.java b/server/sonar-server/src/main/java/org/sonar/server/batch/ProjectRepositoryLoader.java
index e520ecf1e07..6d4ce4855e1 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/batch/ProjectRepositoryLoader.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/batch/ProjectRepositoryLoader.java
@@ -220,7 +220,7 @@ public class ProjectRepositoryLoader {
* If no profile found, try to find the quality profile set on the project (if provided)
* If still no profile found, try to find the default profile of the language
* <p/>
- * Never return null because a default profile should always be set on ech language
+ * Never return null because a default profile should always be set on each language
*/
private QualityProfileDto getProfile(String languageKey, @Nullable String projectKey, @Nullable String profileName, DbSession session) {
QualityProfileDto qualityProfileDto = profileName != null ? qProfileFactory.getByNameAndLanguage(session, profileName, languageKey) : null;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java
index f9927daa8d1..e6dead6ed07 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/SearchAction.java
@@ -64,11 +64,8 @@ public class SearchAction implements QProfileWsAction {
private static final String PARAM_LANGUAGE = FIELD_LANGUAGE;
private final Languages languages;
-
private final QProfileLookup profileLookup;
-
private final QProfileLoader profileLoader;
-
private final QualityProfileDao qualityProfileDao;
public SearchAction(Languages languages, QProfileLookup profileLookup, QProfileLoader profileLoader, QualityProfileDao qualityProfileDao) {
@@ -84,17 +81,12 @@ public class SearchAction implements QProfileWsAction {
.setSince("5.2")
.setDescription("List quality profiles.")
.setHandler(this)
+ .addFieldsParam(ALL_FIELDS)
.setResponseExample(getClass().getResource("example-search.json"));
search.createParam(PARAM_LANGUAGE)
.setDescription("The key of a language supported by the platform. If specified, only profiles for the given language are returned.")
- .setExampleValue("js")
.setPossibleValues(LanguageParamUtils.getLanguageKeys(languages));
-
- search.createParam(Param.FIELDS)
- .setDescription("Use to restrict returned fields.")
- .setExampleValue("key,language")
- .setPossibleValues(ALL_FIELDS);
}
@Override