]> source.dussan.org Git - sonarqube.git/commitdiff
Try to fix error at analysis of SQ (bad class cast)
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 31 Oct 2014 08:28:00 +0000 (09:28 +0100)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Fri, 31 Oct 2014 08:28:05 +0000 (09:28 +0100)
server/sonar-server/src/main/java/org/sonar/server/activity/index/ActivityNormalizer.java

index 92ea174dac8f3111a93c80700ed926b7f5cd647c..8568ab632d57a09bea1dc7dfa475e60ea3ac959d 100644 (file)
@@ -30,12 +30,7 @@ import org.sonar.server.search.IndexField;
 import org.sonar.server.search.Indexable;
 
 import java.lang.reflect.Field;
-import java.lang.reflect.Modifier;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 /**
  * @since 4.4
@@ -59,7 +54,7 @@ public class ActivityNormalizer extends BaseNormalizer<ActivityDto, String> {
     private static Set<IndexField> getAllFields() {
       Set<IndexField> fields = new HashSet<IndexField>();
       for (Field classField : LogFields.class.getDeclaredFields()) {
-        if (Modifier.isFinal(classField.getModifiers()) && Modifier.isStatic(classField.getModifiers())) {
+        if (classField.getType().isAssignableFrom(IndexField.class)) {
           try {
             fields.add(IndexField.class.cast(classField.get(null)));
           } catch (IllegalAccessException e) {