]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8172 fix support for empty parameter in WsClient's Request
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 7 Nov 2016 16:06:11 +0000 (17:06 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 8 Nov 2016 17:02:54 +0000 (18:02 +0100)
sonar-ws/src/main/java/org/sonarqube/ws/client/BaseRequest.java

index 5357d581a7d39ebe4c67674eb44e16ce75c63f71..9f8acecc413415bae15369d7223f50ebeac893fe 100644 (file)
@@ -153,7 +153,7 @@ abstract class BaseRequest<SELF extends BaseRequest> implements WsRequest {
 
     private DefaultParameters setValue(String key, String value) {
       checkArgument(!isNullOrEmpty(key));
-      checkArgument(!isNullOrEmpty(value));
+      checkArgument(value != null);
 
       keyValues.putAll(key, singletonList(value));
       return this;
@@ -163,7 +163,7 @@ abstract class BaseRequest<SELF extends BaseRequest> implements WsRequest {
       checkArgument(!isNullOrEmpty(key));
       checkArgument(values != null && !values.isEmpty());
 
-      this.keyValues.putAll(key, values.stream().map(Object::toString).collect(Collectors.toList()));
+      this.keyValues.putAll(key, values.stream().map(Object::toString).filter(Objects::nonNull).collect(Collectors.toList()));
 
       return this;
     }