diff options
author | Godin <mandrikov@gmail.com> | 2010-12-21 02:59:51 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-12-21 02:59:51 +0000 |
commit | 36dafcc365bb96d05d0d834a030bd8b421f10ec7 (patch) | |
tree | 2fe4f798ebf70d99389bfb8b91f46e5804733f3f /sonar-server | |
parent | 53fdf23671b1ae1ebf1541705ab49d6c30f72bd4 (diff) | |
download | sonarqube-36dafcc365bb96d05d0d834a030bd8b421f10ec7.tar.gz sonarqube-36dafcc365bb96d05d0d834a030bd8b421f10ec7.zip |
SONAR-1722: Minor fixes
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/java/org/sonar/server/configuration/ProfilesManager.java | 12 |
1 files changed, 7 insertions, 5 deletions
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 5a91e742b6b..147e8132f70 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 @@ -125,14 +125,14 @@ public class ProfilesManager extends BaseDao { } /** - * @return true, if setting childProfile as a child of profile adds cycle + * @return true, if setting <code>childProfile</code> as a child of <code>parentProfile</code> adds cycle */ - boolean isCycle(RulesProfile childProfile, RulesProfile profile) { - while (profile != null) { - if (childProfile.equals(profile)) { + boolean isCycle(RulesProfile childProfile, RulesProfile parentProfile) { + while (parentProfile != null) { + if (childProfile.equals(parentProfile)) { return true; } - profile = getParentProfile(profile); + parentProfile = getParentProfile(parentProfile); } return false; } @@ -148,6 +148,7 @@ public class ProfilesManager extends BaseDao { activeRule.setInherited(true); activeRule.setOverridden(false); profile.getActiveRules().add(activeRule); + getSession().saveWithoutFlush(activeRule); for (RulesProfile child : getChildren(profile)) { activateOrChange(child, activeRule); @@ -174,6 +175,7 @@ public class ProfilesManager extends BaseDao { activeRule.setInherited(true); activeRule.setOverridden(false); profile.getActiveRules().add(activeRule); + getSession().saveWithoutFlush(activeRule); for (RulesProfile child : getChildren(profile)) { activateOrChange(child, activeRule); |