From b9970607d50b8de81b6a43fd00f373f37989423c Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 16 Jan 2014 11:31:46 +0100 Subject: SONAR-4908 support deprecated param type REGULAR_EXPRESSION --- sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleParamType.java | 2 +- .../src/test/java/org/sonar/api/rule/RuleParamTypeTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'sonar-plugin-api') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleParamType.java b/sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleParamType.java index 953962c5fc2..198ba4d072d 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleParamType.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleParamType.java @@ -81,7 +81,7 @@ public final class RuleParamType { if ("i".equals(s) || "i{}".equals(s)) { return INTEGER; } - if ("s".equals(s) || "s{}".equals(s) || "r".equals(s)) { + if ("s".equals(s) || "s{}".equals(s) || "r".equals(s) || "REGULAR_EXPRESSION".equals(s)) { return STRING; } if ("b".equals(s)) { diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleParamTypeTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleParamTypeTest.java index b4da1f21274..0df7557487e 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleParamTypeTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleParamTypeTest.java @@ -85,6 +85,7 @@ public class RuleParamTypeTest { assertThat(RuleParamType.parse("r")).isEqualTo(RuleParamType.STRING); assertThat(RuleParamType.parse("TEXT")).isEqualTo(RuleParamType.TEXT); assertThat(RuleParamType.parse("STRING")).isEqualTo(RuleParamType.STRING); + assertThat(RuleParamType.parse("REGULAR_EXPRESSION")).isEqualTo(RuleParamType.STRING); RuleParamType list = RuleParamType.parse("s[FOO,BAR]"); assertThat(list.type()).isEqualTo("SINGLE_SELECT_LIST"); assertThat(list.options()).containsOnly("FOO", "BAR"); -- cgit v1.2.3