aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-12-07 10:15:29 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2012-12-07 10:15:29 +0100
commit428fbadc5f117da2a8e2bb8a9e43ddbf809f6fdb (patch)
treef915ceafcf903a1071ea305e6300a74c9725ab1c /sonar-plugin-api
parent169c63d511d2f657520c0c301da6ba984fb3b253 (diff)
downloadsonarqube-428fbadc5f117da2a8e2bb8a9e43ddbf809f6fdb.tar.gz
sonarqube-428fbadc5f117da2a8e2bb8a9e43ddbf809f6fdb.zip
Fix some quality flaws
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java b/sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java
index b5d407ea3a8..9101b71db48 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java
@@ -150,10 +150,8 @@ public final class AnnotationCheckFactory extends CheckFactory {
List<Field> fields = FieldUtils2.getFields(check.getClass(), true);
for (Field field : fields) {
RuleProperty propertyAnnotation = field.getAnnotation(RuleProperty.class);
- if (propertyAnnotation != null) {
- if (StringUtils.equals(key, field.getName()) || StringUtils.equals(key, propertyAnnotation.key())) {
- return field;
- }
+ if (propertyAnnotation != null && (StringUtils.equals(key, field.getName()) || StringUtils.equals(key, propertyAnnotation.key()))) {
+ return field;
}
}
return null;