summaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2014-01-16 11:31:46 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2014-01-16 11:31:59 +0100
commitb9970607d50b8de81b6a43fd00f373f37989423c (patch)
treeedfd242d230ba2cd5ace0df817b0f0efb2c2dd6a /sonar-plugin-api
parentf5e00efa3bab2bbe4b6e6f602ac1ccd381eeab91 (diff)
downloadsonarqube-b9970607d50b8de81b6a43fd00f373f37989423c.tar.gz
sonarqube-b9970607d50b8de81b6a43fd00f373f37989423c.zip
SONAR-4908 support deprecated param type REGULAR_EXPRESSION
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rule/RuleParamType.java2
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/rule/RuleParamTypeTest.java1
2 files changed, 2 insertions, 1 deletions
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");