diff options
author | Godin <mandrikov@gmail.com> | 2010-12-17 09:04:09 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-12-17 09:04:09 +0000 |
commit | e58aaf76c2ed38afe902877c764ef4bbc2f43de6 (patch) | |
tree | e0fb3a347383cec930eb5768bcff143f201e4ffd /sonar-server/src/main | |
parent | e667b00eee25a28e8def39ae411433cd9b2c6704 (diff) | |
download | sonarqube-e58aaf76c2ed38afe902877c764ef4bbc2f43de6.tar.gz sonarqube-e58aaf76c2ed38afe902877c764ef4bbc2f43de6.zip |
Fix bug in ActiveRule.clone()
Diffstat (limited to 'sonar-server/src/main')
-rw-r--r-- | sonar-server/src/main/java/org/sonar/server/configuration/ProfilesBackup.java | 2 | ||||
-rw-r--r-- | sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java | 13 |
2 files changed, 2 insertions, 13 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesBackup.java b/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesBackup.java index c1259bb32b4..67ef7de9185 100644 --- a/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesBackup.java +++ b/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesBackup.java @@ -75,7 +75,7 @@ public class ProfilesBackup implements Backupable { public void importXml(SonarConfig sonarConfig) { if (CollectionUtils.isNotEmpty(sonarConfig.getProfiles())) { - ProfilesManager profilesManager = new ProfilesManager(session, null, null, null); + ProfilesManager profilesManager = new ProfilesManager(session, null); profilesManager.deleteAllProfiles(); RulesDao rulesDao = new RulesDao(session); diff --git a/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java b/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java index e92496bfd6f..2cf094e8ac0 100644 --- a/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java +++ b/sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java @@ -19,13 +19,10 @@ */ package org.sonar.server.configuration; -import org.sonar.api.Plugins; import org.sonar.api.database.DatabaseSession; import org.sonar.api.database.model.ResourceModel; import org.sonar.api.profiles.RulesProfile; import org.sonar.api.rules.ActiveRule; -import org.sonar.api.rules.ActiveRuleParam; -import org.sonar.api.rules.DefaultRulesManager; import org.sonar.api.rules.Rule; import org.sonar.jpa.dao.BaseDao; import org.sonar.jpa.dao.RulesDao; @@ -34,15 +31,11 @@ import java.util.List; public class ProfilesManager extends BaseDao { - private DefaultRulesManager rulesManager; private RulesDao rulesDao; - private Plugins plugins; - public ProfilesManager(DatabaseSession session, RulesDao rulesDao, Plugins plugins, DefaultRulesManager rulesManager) { + public ProfilesManager(DatabaseSession session, RulesDao rulesDao) { super(session); - this.rulesManager = rulesManager; this.rulesDao = rulesDao; - this.plugins = plugins; } public void copyProfile(int profileId, String newProfileName) { @@ -133,10 +126,6 @@ public class ProfilesManager extends BaseDao { removeActiveRule(profile, activeRule); } activeRule = (ActiveRule) parentActiveRule.clone(); - // TODO Godin: it means that we have bug in ActiveRule.clone() - for (ActiveRuleParam param : activeRule.getActiveRuleParams()) { - param.setActiveRule(activeRule); - } activeRule.setRulesProfile(profile); activeRule.setInherited(true); profile.getActiveRules().add(activeRule); |