]> source.dussan.org Git - sonarqube.git/commitdiff
fix quality flaw (dead code)
authorStephane Gamard <stephane.gamard@searchbox.com>
Fri, 16 May 2014 17:00:13 +0000 (19:00 +0200)
committerStephane Gamard <stephane.gamard@searchbox.com>
Mon, 19 May 2014 05:44:53 +0000 (07:44 +0200)
sonar-server/src/main/java/org/sonar/server/rule2/index/RuleResult.java

index 35dddc9f6bf97cab7566fedd309fe3f2c95803a2..1689bd64f482cf0d894d1460c704baed06aaa7ac 100644 (file)
@@ -22,7 +22,6 @@ package org.sonar.server.rule2.index;
 import com.google.common.collect.ArrayListMultimap;
 import com.google.common.collect.Multimap;
 import org.elasticsearch.action.search.SearchResponse;
-import org.elasticsearch.search.SearchHit;
 import org.sonar.server.qualityprofile.index.ActiveRuleDoc;
 import org.sonar.server.rule2.Rule;
 import org.sonar.server.search.Result;
@@ -32,23 +31,11 @@ import java.util.Map;
 
 public class RuleResult extends Result<Rule> {
 
-  private Multimap<String,ActiveRuleDoc> activeRules = ArrayListMultimap.create();
+  private Multimap<String,ActiveRuleDoc> activeRules;
 
   public RuleResult(SearchResponse response) {
     super(response);
-
-    for (SearchHit hit : response.getHits()) {
-
-      String ruleKey = (String) hit.getSource().get(RuleNormalizer.RuleField.KEY.key());
-//      if (hit.getFields().containsKey(RuleNormalizer.RuleField.ACTIVE.key())) {
-//        Map<String, Map<String, Object>> activeRulesForHit =
-//          hit.getFields().get(RuleNormalizer.RuleField.ACTIVE.key()).getValue();
-//        for (Map.Entry<String, Map<String, Object>> activeRule : activeRulesForHit.entrySet()) {
-//          activeRules.put(ruleKey,
-//            new ActiveRuleDoc(ActiveRuleKey.parse(activeRule.getKey()), activeRule.getValue()));
-//        }
-//      }
-    }
+    activeRules = ArrayListMultimap.create();
   }
 
   @Override