From ca41c6737159ebb6fc8d2cd06125631dc8807ed3 Mon Sep 17 00:00:00 2001 From: oowekyala Date: Sat, 15 Jul 2017 16:50:46 +0200 Subject: [PATCH] Checkstyle fixes --- .../sourceforge/pmd/AbstractPropertyDescriptorFactory.java | 7 +++---- pmd-core/src/main/java/net/sourceforge/pmd/RuleSet.java | 1 - .../src/main/java/net/sourceforge/pmd/RuleSetFactory.java | 5 +++-- .../main/java/net/sourceforge/pmd/RuleSetReferenceId.java | 1 - .../pmd/lang/rule/properties/CharacterProperty.java | 1 - .../pmd/lang/rule/properties/DoubleProperty.java | 1 - .../pmd/lang/rule/properties/StringProperty.java | 1 - 7 files changed, 6 insertions(+), 11 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/AbstractPropertyDescriptorFactory.java b/pmd-core/src/main/java/net/sourceforge/pmd/AbstractPropertyDescriptorFactory.java index 308d47d963..f936168cb5 100755 --- a/pmd-core/src/main/java/net/sourceforge/pmd/AbstractPropertyDescriptorFactory.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/AbstractPropertyDescriptorFactory.java @@ -155,8 +155,7 @@ public abstract class AbstractPropertyDescriptorFactory implements PropertyDe * @return True if the value must be considered missing, false otherwise */ protected boolean isValueMissing(String value) { - // return StringUtil.isEmpty(value); - return false; + return StringUtils.isBlank(value); } @@ -296,13 +295,13 @@ public abstract class AbstractPropertyDescriptorFactory implements PropertyDe * Returns a map describing which fields are required to build a property using this factory. The parameters are * added to the {@link PropertyDescriptor#CORE_EXPECTED_FIELDS}, which are required for all descriptors. * - * @param otherKeys Additional keys + * @param otherKeys Additional keys * @param otherValues Whether the corresponding keys are required or not * * @return The complete map of expected fields. */ static Map expectedFieldTypesWith(PropertyDescriptorField[] otherKeys, - Boolean[] otherValues) { + Boolean[] otherValues) { Map largerMap = new HashMap<>( otherKeys.length + CORE_EXPECTED_FIELDS.size()); largerMap.putAll(CORE_EXPECTED_FIELDS); diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSet.java b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSet.java index c5e25f052b..790a2cd8bb 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSet.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSet.java @@ -26,7 +26,6 @@ import net.sourceforge.pmd.lang.LanguageVersion; import net.sourceforge.pmd.lang.ast.Node; import net.sourceforge.pmd.lang.rule.RuleReference; import net.sourceforge.pmd.util.CollectionUtil; -import net.sourceforge.pmd.util.StringUtil; import net.sourceforge.pmd.util.filter.Filter; import net.sourceforge.pmd.util.filter.Filters; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactory.java b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactory.java index a79c98f6f5..79026d54a7 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactory.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetFactory.java @@ -845,8 +845,9 @@ public class RuleSetFactory { // populate a map of values for an individual descriptor for (PropertyDescriptorField field : valueKeys) { String valueStr = propertyElement.getAttribute(field.attributeName()); - if (valueStr != null) - values.put(field, valueStr); + if (valueStr != null) { + values.put(field, valueStr); + } } if (StringUtils.isBlank(values.get(DEFAULT_VALUE))) { diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java index b0c033ceea..74a685de99 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/RuleSetReferenceId.java @@ -16,7 +16,6 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import net.sourceforge.pmd.util.ResourceLoader; -import net.sourceforge.pmd.util.StringUtil; /** * This class is used to parse a RuleSet reference value. Most commonly used for diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/CharacterProperty.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/CharacterProperty.java index 7fe83faca1..cc821dc1d9 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/CharacterProperty.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/CharacterProperty.java @@ -12,7 +12,6 @@ import org.apache.commons.lang3.StringUtils; import net.sourceforge.pmd.PropertyDescriptorFactory; import net.sourceforge.pmd.PropertyDescriptorField; -import net.sourceforge.pmd.util.StringUtil; /** * Defines a property type that supports single Character values. diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/DoubleProperty.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/DoubleProperty.java index 17f406d631..ad1621d074 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/DoubleProperty.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/DoubleProperty.java @@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.rule.properties; import static net.sourceforge.pmd.lang.rule.properties.ValueParser.DOUBLE_PARSER; -import java.util.Arrays; import java.util.Map; import net.sourceforge.pmd.PropertyDescriptorFactory; diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/StringProperty.java b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/StringProperty.java index a02498fdeb..47de949805 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/StringProperty.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/properties/StringProperty.java @@ -10,7 +10,6 @@ import org.apache.commons.lang3.StringUtils; import net.sourceforge.pmd.PropertyDescriptorFactory; import net.sourceforge.pmd.PropertyDescriptorField; -import net.sourceforge.pmd.util.StringUtil; /** * Defines a datatype that supports single String values.