From 026111175ba6fd17945f0c86f7c6e907db2f32d4 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 27 Jan 2017 11:31:32 +0100 Subject: SONAR-7300 Display a proper message when id is missing --- sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sonar-plugin-api/src') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java index 9296817a6b1..2bdb4e854c5 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Request.java @@ -71,9 +71,7 @@ public abstract class Request { */ public String mandatoryParam(String key) { String value = param(key); - if (value == null) { - throw new IllegalArgumentException(String.format(MSG_PARAMETER_MISSING, key)); - } + checkArgument(value != null, String.format(MSG_PARAMETER_MISSING, key)); return value; } -- cgit v1.2.3