aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2019-01-22 13:00:53 +0100
committersonartech <sonartech@sonarsource.com>2019-02-11 09:11:42 +0100
commit1361ba5fb9d1bf5f98cba5feff9227f177a44e94 (patch)
tree88c6b29b83a6fc67ac38950c2d5adadc1fa7f97d /sonar-ws
parent37f879c7c552d23eeffdc6746aab58b7fd2db4a9 (diff)
downloadsonarqube-1361ba5fb9d1bf5f98cba5feff9227f177a44e94.tar.gz
sonarqube-1361ba5fb9d1bf5f98cba5feff9227f177a44e94.zip
SONAR-10199 Fix search of issues by author containing comma
Diffstat (limited to 'sonar-ws')
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsParameters.java9
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/issues/IssuesService.java15
-rw-r--r--sonar-ws/src/main/java/org/sonarqube/ws/client/issues/SearchRequest.java27
3 files changed, 39 insertions, 12 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsParameters.java
index 90bb5600ea6..041813066b1 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsParameters.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issue/IssuesWsParameters.java
@@ -88,7 +88,14 @@ public class IssuesWsParameters {
@Deprecated
public static final String PARAM_REPORTERS = "reporters";
public static final String PARAM_ASSIGNEES = "assignees";
- public static final String PARAM_AUTHORS = "authors";
+
+ /**
+ * @deprecated since 7.7, please use 'author' instead
+ */
+ @Deprecated
+ public static final String DEPRECATED_PARAM_AUTHORS = "authors";
+
+ public static final String PARAM_AUTHOR = "author";
public static final String PARAM_LANGUAGES = "languages";
public static final String PARAM_TAGS = "tags";
public static final String PARAM_TYPES = "types";
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/IssuesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/IssuesService.java
index 4a5ade2fa95..bd898f434d9 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/IssuesService.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/IssuesService.java
@@ -147,7 +147,8 @@ public class IssuesService extends BaseService {
.setParam("componentUuid", request.getComponentUuid())
.setParam("createdAfter", request.getCreatedAfter())
.setParam("ps", request.getPs())
- .setMediaType(MediaTypes.JSON)).content();
+ .setMediaType(MediaTypes.JSON)
+ ).content();
}
/**
@@ -191,7 +192,8 @@ public class IssuesService extends BaseService {
new PostRequest(path("edit_comment"))
.setParam("comment", request.getComment())
.setParam("text", request.getText())
- .setMediaType(MediaTypes.JSON)).content();
+ .setMediaType(MediaTypes.JSON)
+ ).content();
}
/**
@@ -208,6 +210,7 @@ public class IssuesService extends BaseService {
.setParam("asc", request.getAsc())
.setParam("assigned", request.getAssigned())
.setParam("assignees", request.getAssignees() == null ? null : request.getAssignees().stream().collect(Collectors.joining(",")))
+ .setParam("author", request.getAuthor())
.setParam("authors", request.getAuthors() == null ? null : request.getAuthors().stream().collect(Collectors.joining(",")))
.setParam("branch", request.getBranch())
.setParam("componentKeys", request.getComponentKeys() == null ? null : request.getComponentKeys().stream().collect(Collectors.joining(",")))
@@ -219,6 +222,7 @@ public class IssuesService extends BaseService {
.setParam("createdAt", request.getCreatedAt())
.setParam("createdBefore", request.getCreatedBefore())
.setParam("createdInLast", request.getCreatedInLast())
+ .setParam("cwe", request.getCwe() == null ? null : request.getCwe().stream().collect(Collectors.joining(",")))
.setParam("directories", request.getDirectories() == null ? null : request.getDirectories().stream().collect(Collectors.joining(",")))
.setParam("facetMode", request.getFacetMode())
.setParam("facets", request.getFacets() == null ? null : request.getFacets().stream().collect(Collectors.joining(",")))
@@ -228,6 +232,7 @@ public class IssuesService extends BaseService {
.setParam("moduleUuids", request.getModuleUuids() == null ? null : request.getModuleUuids().stream().collect(Collectors.joining(",")))
.setParam("onComponentOnly", request.getOnComponentOnly())
.setParam("organization", request.getOrganization())
+ .setParam("owaspTop10", request.getOwaspTop10() == null ? null : request.getOwaspTop10().stream().collect(Collectors.joining(",")))
.setParam("p", request.getP())
.setParam("projects", request.getProjects() == null ? null : request.getProjects().stream().collect(Collectors.joining(",")))
.setParam("ps", request.getPs())
@@ -236,14 +241,12 @@ public class IssuesService extends BaseService {
.setParam("resolved", request.getResolved())
.setParam("rules", request.getRules() == null ? null : request.getRules().stream().collect(Collectors.joining(",")))
.setParam("s", request.getS())
+ .setParam("sansTop25", request.getSansTop25() == null ? null : request.getSansTop25().stream().collect(Collectors.joining(",")))
.setParam("severities", request.getSeverities() == null ? null : request.getSeverities().stream().collect(Collectors.joining(",")))
.setParam("sinceLeakPeriod", request.getSinceLeakPeriod())
.setParam("statuses", request.getStatuses() == null ? null : request.getStatuses().stream().collect(Collectors.joining(",")))
.setParam("tags", request.getTags() == null ? null : request.getTags().stream().collect(Collectors.joining(",")))
- .setParam("types", request.getTypes() == null ? null : request.getTypes().stream().collect(Collectors.joining(",")))
- .setParam("owaspTop10", request.getOwaspTop10() == null ? null : request.getOwaspTop10().stream().collect(Collectors.joining(",")))
- .setParam("sansTop25", request.getSansTop25() == null ? null : request.getSansTop25().stream().collect(Collectors.joining(",")))
- .setParam("cwe", request.getCwe() == null ? null : request.getCwe().stream().collect(Collectors.joining(","))),
+ .setParam("types", request.getTypes() == null ? null : request.getTypes().stream().collect(Collectors.joining(","))),
SearchWsResponse.parser());
}
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/SearchRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/SearchRequest.java
index 62906e70b70..08407bcda0e 100644
--- a/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/SearchRequest.java
+++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/issues/SearchRequest.java
@@ -35,6 +35,7 @@ public class SearchRequest {
private String asc;
private String assigned;
private List<String> assignees;
+ private List<String> author;
private List<String> authors;
private String branch;
private List<String> componentKeys;
@@ -143,8 +144,22 @@ public class SearchRequest {
}
/**
+ * Example value: "author=torvalds@linux-foundation.org&author=linux@fondation.org"
+ */
+ public SearchRequest setAuthor(List<String> author) {
+ this.author = author;
+ return this;
+ }
+
+ public List<String> getAuthor() {
+ return author;
+ }
+
+ /**
* Example value: "torvalds@linux-foundation.org"
+ * @deprecated since 7.7
*/
+ @Deprecated
public SearchRequest setAuthors(List<String> authors) {
this.authors = authors;
return this;
@@ -310,7 +325,6 @@ public class SearchRequest {
* <ul>
* <li>"count"</li>
* <li>"effort"</li>
- * <li>"debt"</li>
* </ul>
*/
public SearchRequest setFacetMode(String facetMode) {
@@ -325,18 +339,19 @@ public class SearchRequest {
/**
* Possible values:
* <ul>
+ * <li>"projects"</li>
+ * <li>"moduleUuids"</li>
+ * <li>"fileUuids"</li>
+ * <li>"assigned_to_me"</li>
* <li>"severities"</li>
* <li>"statuses"</li>
* <li>"resolutions"</li>
* <li>"actionPlans"</li>
- * <li>"projectUuids"</li>
* <li>"rules"</li>
* <li>"assignees"</li>
- * <li>"assigned_to_me"</li>
* <li>"reporters"</li>
* <li>"authors"</li>
- * <li>"moduleUuids"</li>
- * <li>"fileUuids"</li>
+ * <li>"author"</li>
* <li>"directories"</li>
* <li>"languages"</li>
* <li>"tags"</li>
@@ -396,7 +411,9 @@ public class SearchRequest {
/**
* This is part of the internal API.
* Example value: "7d8749e8-3070-4903-9188-bdd82933bb92"
+ * @deprecated since 7.6
*/
+ @Deprecated
public SearchRequest setModuleUuids(List<String> moduleUuids) {
this.moduleUuids = moduleUuids;
return this;