From 2c907a02fefd50ae1f23817acdc3bd49c9693bf2 Mon Sep 17 00:00:00 2001 From: Brian Remedios Date: Sat, 25 Oct 2008 22:43:36 +0000 Subject: [PATCH] typos & minor optimizations git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@6675 51baf565-9d33-0410-a72c-fc3788e3496d --- .../runtime/properties/impl/ProjectPropertiesImpl.java | 8 +++----- .../properties/impl/ProjectPropertiesManagerImpl.java | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pmd-eclipse-plugin/plugins/net.sourceforge.pmd.eclipse.plugin/src/net/sourceforge/pmd/eclipse/runtime/properties/impl/ProjectPropertiesImpl.java b/pmd-eclipse-plugin/plugins/net.sourceforge.pmd.eclipse.plugin/src/net/sourceforge/pmd/eclipse/runtime/properties/impl/ProjectPropertiesImpl.java index 7777a65bae..079f0b9c89 100644 --- a/pmd-eclipse-plugin/plugins/net.sourceforge.pmd.eclipse.plugin/src/net/sourceforge/pmd/eclipse/runtime/properties/impl/ProjectPropertiesImpl.java +++ b/pmd-eclipse-plugin/plugins/net.sourceforge.pmd.eclipse.plugin/src/net/sourceforge/pmd/eclipse/runtime/properties/impl/ProjectPropertiesImpl.java @@ -48,6 +48,7 @@ import net.sourceforge.pmd.eclipse.runtime.properties.IProjectPropertiesManager; import net.sourceforge.pmd.eclipse.runtime.properties.PropertiesException; import net.sourceforge.pmd.eclipse.runtime.writer.IRuleSetWriter; import net.sourceforge.pmd.eclipse.runtime.writer.WriterException; +import net.sourceforge.pmd.util.StringUtil; import org.apache.log4j.Logger; import org.eclipse.core.resources.IFile; @@ -154,11 +155,8 @@ public class ProjectPropertiesImpl implements IProjectProperties { * @see net.sourceforge.pmd.eclipse.runtime.properties.IProjectProperties#getRuleSetFile() */ public String getRuleSetFile() { - if (this.ruleSetFile == null || this.ruleSetFile.trim().length() == 0) { - return PROJECT_RULESET_FILE; - } else { - return this.ruleSetFile; - } + + return StringUtil.isEmpty(ruleSetFile) ? PROJECT_RULESET_FILE : ruleSetFile; } /** diff --git a/pmd-eclipse-plugin/plugins/net.sourceforge.pmd.eclipse.plugin/src/net/sourceforge/pmd/eclipse/runtime/properties/impl/ProjectPropertiesManagerImpl.java b/pmd-eclipse-plugin/plugins/net.sourceforge.pmd.eclipse.plugin/src/net/sourceforge/pmd/eclipse/runtime/properties/impl/ProjectPropertiesManagerImpl.java index d44e34332d..b2a379b756 100644 --- a/pmd-eclipse-plugin/plugins/net.sourceforge.pmd.eclipse.plugin/src/net/sourceforge/pmd/eclipse/runtime/properties/impl/ProjectPropertiesManagerImpl.java +++ b/pmd-eclipse-plugin/plugins/net.sourceforge.pmd.eclipse.plugin/src/net/sourceforge/pmd/eclipse/runtime/properties/impl/ProjectPropertiesManagerImpl.java @@ -330,7 +330,7 @@ public class ProjectPropertiesManagerImpl implements IProjectPropertiesManager { boolean flChanged = false; if (!projectRuleSet.getRules().equals(pluginRuleSet.getRules())) { - log.debug("The project ruleset is different from the plugin ruleset ; synchronizing."); + log.debug("The project ruleset is different from the plugin ruleset; synchronizing."); // 1-If rules have been deleted from preferences // delete them also from the project ruleset @@ -339,7 +339,7 @@ public class ProjectPropertiesManagerImpl implements IProjectPropertiesManager { final Rule projectRule = i.next(); final Rule pluginRule = pluginRuleSet.getRuleByName(projectRule.getName()); if (pluginRule == null) { - log.debug("The rule " + projectRule.getName() + " is no more defined in the plugin ruleset. Remove it."); + log.debug("The rule " + projectRule.getName() + " is not defined in the plugin ruleset. Remove it."); i.remove(); } } @@ -357,7 +357,7 @@ public class ProjectPropertiesManagerImpl implements IProjectPropertiesManager { } if (!ruleSet.getRules().equals(projectRuleSet.getRules())) { - log.info("Set the projet ruleset according to preferences."); + log.info("Set the project ruleset according to preferences."); projectProperties.setProjectRuleSet(ruleSet); flChanged = true; }