aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@sonarsource.com>2014-10-10 08:44:16 +0200
committerStephane Gamard <stephane.gamard@sonarsource.com>2014-10-10 08:44:31 +0200
commit6e7ab5482d87e628b0ce1e8ad17029a25ac2d43f (patch)
treede74ae0c1e782b9edad9b4e3d2e3f08544dfa4dc /sonar-plugin-api
parent20a6fd8e867f919982fc1869a73f5fff5885b739 (diff)
downloadsonarqube-6e7ab5482d87e628b0ce1e8ad17029a25ac2d43f.tar.gz
sonarqube-6e7ab5482d87e628b0ce1e8ad17029a25ac2d43f.zip
fix quality flaws (KeyValueFormat.parse can accept null data)
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/KeyValueFormat.java3
1 files changed, 2 insertions, 1 deletions
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 <K, V> Map<K, V> parse(String data, Converter<K> keyConverter, Converter<V> valueConverter) {
+ public static <K, V> Map<K, V> parse(@Nullable String data, Converter<K> keyConverter, Converter<V> valueConverter) {
Map<K, V> map = Maps.newLinkedHashMap();
if (data != null) {
String[] pairs = StringUtils.split(data, PAIR_SEPARATOR);