From 6e7ab5482d87e628b0ce1e8ad17029a25ac2d43f Mon Sep 17 00:00:00 2001 From: Stephane Gamard Date: Fri, 10 Oct 2014 08:44:16 +0200 Subject: fix quality flaws (KeyValueFormat.parse can accept null data) --- sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sonar-plugin-api') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java index 45e144bd0b4..d9556f9661a 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java @@ -29,6 +29,7 @@ import org.apache.commons.lang.math.NumberUtils; import org.slf4j.LoggerFactory; import org.sonar.api.rules.RulePriority; +import javax.annotation.Nullable; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -213,7 +214,7 @@ public final class KeyValueFormat { } } - public static Map parse(String data, Converter keyConverter, Converter valueConverter) { + public static Map parse(@Nullable String data, Converter keyConverter, Converter valueConverter) { Map map = Maps.newLinkedHashMap(); if (data != null) { String[] pairs = StringUtils.split(data, PAIR_SEPARATOR); -- cgit v1.2.3