]> source.dussan.org Git - sonarqube.git/commitdiff
Fix some quality flaws
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 7 Dec 2012 09:15:29 +0000 (10:15 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 7 Dec 2012 09:15:29 +0000 (10:15 +0100)
sonar-batch/src/main/java/org/sonar/batch/bootstrapper/Reactor.java
sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java
sonar-plugin-api/src/main/java/org/sonar/api/checks/AnnotationCheckFactory.java

index 1e907c30c0e87fc4b0d593ec92e0bc6073cfd2d9..8c2d23d3da566d972851e563f8d08dfb9f85fee7 100644 (file)
@@ -25,9 +25,10 @@ import java.util.List;
 
 /**
  * Describes order of projects.
- * Used by sonar-runner 1.x. Gradle 1.0 already uses {#link org.sonar.api.batch.bootstrap.ProjectReactor}.
+ * Used by sonar-runner 1.x. Gradle 1.0 already uses {@link org.sonar.api.batch.bootstrap.ProjectReactor}.
  * 
  * @since 2.6
+ * @deprecated replaced by {@link org.sonar.api.batch.bootstrap.ProjectReactor} in version 2.9
  */
 @Deprecated
 public class Reactor {
index b8a7c88e5469c4d6fb24b5c95f22fdf9300c23c3..b4f9e35f856bd89dce77db0a07bff8df558054f9 100644 (file)
@@ -81,8 +81,8 @@ public class ResourceDao {
   }
 
   public SnapshotDto getLastSnapshotByResourceId(long resourceId, SqlSession session) {
-      return session.getMapper(ResourceMapper.class).selectLastSnapshotByResourceId(resourceId);
-    }
+    return session.getMapper(ResourceMapper.class).selectLastSnapshotByResourceId(resourceId);
+  }
 
   public List<ResourceDto> getDescendantProjects(long projectId) {
     SqlSession session = mybatis.openSession();
index b5d407ea3a888a067dc037607265f4eba9f64751..9101b71db489ea7f268c217e89911f9a7edc41ac 100644 (file)
@@ -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;