aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-10-11 21:06:03 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-10-11 21:06:03 +0000
commitd516294a9dd52572f60d0ae977ef5a0c85973356 (patch)
treebf7af5852c6c33eac2bf8c512065c7718a6f1dab /sonar-plugin-api
parent4400a7bd8870b92293ffd446db12fa52c116433c (diff)
downloadsonarqube-d516294a9dd52572f60d0ae977ef5a0c85973356.tar.gz
sonarqube-d516294a9dd52572f60d0ae977ef5a0c85973356.zip
in fact Java 1.5 should support enum in annotations if the enum is defined before the field declaration
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java7
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rules/XMLRuleParser.java2
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/rules/XMLRuleParserTest.java2
3 files changed, 5 insertions, 6 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
index a2999a8452b..d7aaa4a58a7 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
@@ -24,7 +24,6 @@ import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.sonar.api.database.DatabaseProperties;
-import org.sonar.check.Cardinality;
import javax.persistence.*;
import java.util.ArrayList;
@@ -72,7 +71,7 @@ public final class Rule {
@Enumerated(EnumType.STRING)
@Column(name = "cardinality", updatable = true, nullable = false)
- private Cardinality cardinality = Cardinality.SINGLE;
+ private org.sonar.check.Rule.Cardinality cardinality = org.sonar.check.Rule.Cardinality.SINGLE;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "parent_id", updatable = true, nullable = true)
@@ -332,11 +331,11 @@ public final class Rule {
return setRepositoryKey(repositoryKey).setKey(key).setConfigKey(key);
}
- public Cardinality getCardinality() {
+ public org.sonar.check.Rule.Cardinality getCardinality() {
return cardinality;
}
- public Rule setCardinality(Cardinality c) {
+ public Rule setCardinality(org.sonar.check.Rule.Cardinality c) {
this.cardinality = c;
return this;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/XMLRuleParser.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/XMLRuleParser.java
index 760e2463964..9ff321b0457 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/XMLRuleParser.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/XMLRuleParser.java
@@ -139,7 +139,7 @@ public final class XMLRuleParser implements ServerComponent {
rule.setRulesCategory(new RulesCategory(category));
} else if (StringUtils.equalsIgnoreCase("cardinality", nodeName)) {
- rule.setCardinality(org.sonar.check.Cardinality.valueOf(StringUtils.trim(cursor.collectDescendantText(false))));
+ rule.setCardinality(org.sonar.check.Rule.Cardinality.valueOf(StringUtils.trim(cursor.collectDescendantText(false))));
} else if (StringUtils.equalsIgnoreCase("param", nodeName)) {
processParameter(rule, cursor);
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/rules/XMLRuleParserTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/rules/XMLRuleParserTest.java
index c444fdda875..726596e5a7b 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/rules/XMLRuleParserTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/rules/XMLRuleParserTest.java
@@ -22,7 +22,7 @@ package org.sonar.api.rules;
import org.hamcrest.core.Is;
import org.junit.Test;
import org.sonar.api.utils.SonarException;
-import org.sonar.check.Cardinality;
+import org.sonar.check.Rule.Cardinality;
import java.io.StringReader;
import java.util.List;