diff options
author | Jenkins CI <ci@sonarsource.com> | 2012-07-26 23:51:08 +0200 |
---|---|---|
committer | Jenkins CI <ci@sonarsource.com> | 2012-07-26 23:51:08 +0200 |
commit | 79fc401307e2484f7d46cc6d92877dc7a0ac3868 (patch) | |
tree | 4a6e2fb3ac114f1f0872872905d4c6f9d0f62156 /sonar-plugin-api/src/main/java/org/sonar/api | |
parent | 8cf9ce7f62e6eb028f811b6049ed6ae00c176fbc (diff) | |
parent | 84c0fbaa08bc8f5db140e26395a37ce27568cb27 (diff) | |
download | sonarqube-79fc401307e2484f7d46cc6d92877dc7a0ac3868.tar.gz sonarqube-79fc401307e2484f7d46cc6d92877dc7a0ac3868.zip |
Automatic merge from branch-3.2
Diffstat (limited to 'sonar-plugin-api/src/main/java/org/sonar/api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java index df43d139657..ce3bdfacae0 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/AnnotationRuleParser.java @@ -19,8 +19,6 @@ */ package org.sonar.api.rules; -import org.sonar.api.utils.SonarException; - import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; import org.apache.commons.lang.StringUtils; @@ -29,6 +27,8 @@ import org.slf4j.LoggerFactory; import org.sonar.api.PropertyType; import org.sonar.api.ServerComponent; import org.sonar.api.utils.AnnotationUtils; +import org.sonar.api.utils.FieldUtils2; +import org.sonar.api.utils.SonarException; import org.sonar.check.Check; import java.lang.reflect.Field; @@ -72,13 +72,10 @@ public final class AnnotationRuleParser implements ServerComponent { rule.setSeverity(RulePriority.fromCheckPriority(ruleAnnotation.priority())); rule.setCardinality(ruleAnnotation.cardinality()); - Field[] fields = clazz.getDeclaredFields(); - if (fields != null) { - for (Field field : fields) { - addRuleProperty(rule, field); - } + List<Field> fields = FieldUtils2.getFields(clazz, true); + for (Field field : fields) { + addRuleProperty(rule, field); } - return rule; } @@ -89,11 +86,9 @@ public final class AnnotationRuleParser implements ServerComponent { rule.setDescription(checkAnnotation.description()); rule.setSeverity(RulePriority.fromCheckPriority(checkAnnotation.priority())); - Field[] fields = clazz.getDeclaredFields(); - if (fields != null) { - for (Field field : fields) { - addCheckProperty(rule, field); - } + List<Field> fields = FieldUtils2.getFields(clazz, true); + for (Field field : fields) { + addCheckProperty(rule, field); } return rule; } |