]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5007 - remove unecessary duplication of indexing in RuleRegister (explicit...
authorStephane Gamard <stephane.gamard@searchbox.com>
Thu, 12 Jun 2014 17:18:38 +0000 (19:18 +0200)
committerStephane Gamard <stephane.gamard@searchbox.com>
Thu, 12 Jun 2014 17:19:44 +0000 (19:19 +0200)
sonar-server/src/main/java/org/sonar/server/rule/RegisterRules.java

index 4adc3ae8dcac7b0a37f27c226c40bfd257b54a57..8a3f3793be7e9d9f1cf9c6498074846036fd3917 100644 (file)
@@ -41,14 +41,14 @@ import org.sonar.core.technicaldebt.db.CharacteristicDao;
 import org.sonar.core.technicaldebt.db.CharacteristicDto;
 import org.sonar.server.db.DbClient;
 import org.sonar.server.qualityprofile.RuleActivator;
-import org.sonar.server.search.IndexDefinition;
-import org.sonar.server.search.action.EmbeddedIndexAction;
-import org.sonar.server.search.action.IndexAction;
-import org.sonar.server.search.action.KeyIndexAction;
 
 import javax.annotation.Nullable;
-
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import static com.google.common.collect.Lists.newArrayList;
 
@@ -112,10 +112,6 @@ public class RegisterRules implements Startable {
 
           if (executeUpdate) {
             dbClient.ruleDao().update(session, rule);
-          } else {
-            // TODO replace this hack by index synchronizer
-            session.enqueue(new KeyIndexAction<RuleKey>(IndexDefinition.RULE.getIndexType(),
-              IndexAction.Method.UPSERT, rule.getKey()));
           }
 
           mergeParams(ruleDef, rule, session);
@@ -277,10 +273,6 @@ public class RegisterRules implements Startable {
         // TODO store param name
         if (mergeParam(paramDto, paramDef)) {
           dbClient.ruleDao().updateRuleParam(session, rule, paramDto);
-        } else {
-          // TODO to be replaced by synchronizer
-          session.enqueue(new EmbeddedIndexAction<RuleKey>(IndexDefinition.RULE.getIndexType(),
-            IndexAction.Method.UPSERT, paramDto, rule.getKey()));
         }
         existingParamDtoNames.add(paramDto.getName());
       }