From 1fc2f5426e3be939b2e1489f2e7e3ae45454bfb7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Mon, 7 Nov 2016 17:06:11 +0100 Subject: [PATCH] SONAR-8172 fix support for empty parameter in WsClient's Request --- .../src/main/java/org/sonarqube/ws/client/BaseRequest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/BaseRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/BaseRequest.java index 5357d581a7d..9f8acecc413 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/BaseRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/BaseRequest.java @@ -153,7 +153,7 @@ abstract class 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 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; } -- 2.39.5