From 046ecd839d6092b394b82382a3701d6928a0a38e Mon Sep 17 00:00:00 2001 From: Philippe Herlin Date: Mon, 24 Oct 2005 23:19:58 +0000 Subject: [PATCH] Fix never ending loop issue (finally..) git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3934 51baf565-9d33-0410-a72c-fc3788e3496d --- .../model/ProjectPropertiesModelImpl.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pmd-eclipse/src/net/sourceforge/pmd/eclipse/model/ProjectPropertiesModelImpl.java b/pmd-eclipse/src/net/sourceforge/pmd/eclipse/model/ProjectPropertiesModelImpl.java index d80d0e22a7..0ae299b19b 100644 --- a/pmd-eclipse/src/net/sourceforge/pmd/eclipse/model/ProjectPropertiesModelImpl.java +++ b/pmd-eclipse/src/net/sourceforge/pmd/eclipse/model/ProjectPropertiesModelImpl.java @@ -74,6 +74,9 @@ import org.eclipse.ui.PlatformUI; * @version $Revision$ * * $Log$ + * Revision 1.10 2005/10/24 23:19:58 phherlin + * Fix never ending loop issue (finally..) + * * Revision 1.9 2005/10/24 22:42:22 phherlin * Fix never ending loop issue * @@ -187,11 +190,10 @@ public class ProjectPropertiesModelImpl extends AbstractModel implements Project throw new ModelException("Setting a project rule set to null"); // TODO NLS } + this.needRebuild = !this.projectRuleSet.getRules().equals(projectRuleSet.getRules()); this.projectRuleSet = projectRuleSet; - if (synchronizeRuleSet()) { - sync(); - this.needRebuild = true; - } + + this.needRebuild |= synchronizeRuleSet(); } /** @@ -352,11 +354,13 @@ public class ProjectPropertiesModelImpl extends AbstractModel implements Project } } - flChanged = !ruleSet.getRules().equals(this.projectRuleSet.getRules()); - if (flChanged) { + if (!(ruleSet.getRules().equals(this.projectRuleSet.getRules()))) { + log.info("Updating the projet ruleset according to preferences."); this.projectRuleSet = ruleSet; - log.info("Ruleset for project " + this.project.getName() + " is now synchronized."); + flChanged = true; } + + log.info("Ruleset for project " + this.project.getName() + " is now synchronized."); } return flChanged;