flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cd...@apache.org
Subject git commit: [flex-utilities] [refs/heads/feature/flexpmd-pmd-update] - - Finished converting the last Rules to PMD5.x
Date Fri, 05 Sep 2014 11:00:03 GMT
Repository: flex-utilities
Updated Branches:
  refs/heads/feature/flexpmd-pmd-update 7f1d4d2ae -> 3d7976aa6


- Finished converting the last Rules to PMD5.x


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/3d7976aa
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/3d7976aa
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/3d7976aa

Branch: refs/heads/feature/flexpmd-pmd-update
Commit: 3d7976aa6e6433a712b0d9bca526e35a584ecc9a
Parents: 7f1d4d2
Author: Christofer Dutz <christofer.dutz@codecentric.de>
Authored: Fri Sep 5 12:59:55 2014 +0200
Committer: Christofer Dutz <christofer.dutz@codecentric.de>
Committed: Fri Sep 5 12:59:55 2014 +0200

----------------------------------------------------------------------
 .../ac/pmd/rules/mxml/TooManyStatesInMxmlRule.java  | 14 +-------------
 .../ac/pmd/rules/naming/TooShortVariableRule.java   | 16 ++--------------
 .../TooFewBrancheInSwitchStatementRule.java         | 12 +-----------
 .../ParameterizedRegExpBasedRuleTest.java           |  3 ++-
 4 files changed, 6 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3d7976aa/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/mxml/TooManyStatesInMxmlRule.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/mxml/TooManyStatesInMxmlRule.java
b/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/mxml/TooManyStatesInMxmlRule.java
index d0ac6c5..025e7e0 100644
--- a/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/mxml/TooManyStatesInMxmlRule.java
+++ b/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/mxml/TooManyStatesInMxmlRule.java
@@ -17,14 +17,12 @@
 package com.adobe.ac.pmd.rules.mxml;
 
 import java.util.List;
-import java.util.Map;
 
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathExpressionException;
 
 import net.sourceforge.pmd.PropertyDescriptor;
-
 import org.w3c.dom.Document;
 
 import com.adobe.ac.pmd.IFlexViolation;
@@ -68,7 +66,7 @@ public class TooManyStatesInMxmlRule extends AbstractXpathRelatedRule implements
     */
    public int getThreshold()
    {
-      return getIntProperty( propertyDescriptorFor( getThresholdName() ) );
+       return getProperty( (PropertyDescriptor<Integer>) getPropertyDescriptor( getThresholdName()
) );
    }
 
    /*
@@ -146,14 +144,4 @@ public class TooManyStatesInMxmlRule extends AbstractXpathRelatedRule
implements
                        String.valueOf( getActualValueForTheCurrentViolation() ) );
       }
    }
-
-   /*
-    * (non-Javadoc)
-    * @see net.sourceforge.pmd.CommonAbstractRule#propertiesByName()
-    */
-   @Override
-   protected final Map< String, PropertyDescriptor > propertiesByName()
-   {
-      return getThresholdedRuleProperties( this );
-   }
 }

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3d7976aa/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/naming/TooShortVariableRule.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/naming/TooShortVariableRule.java
b/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/naming/TooShortVariableRule.java
index 6536e90..6c30631 100644
--- a/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/naming/TooShortVariableRule.java
+++ b/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/naming/TooShortVariableRule.java
@@ -16,14 +16,12 @@
  */
 package com.adobe.ac.pmd.rules.naming;
 
-import java.util.Map;
 import java.util.regex.Matcher;
 
-import net.sourceforge.pmd.PropertyDescriptor;
-
 import com.adobe.ac.pmd.rules.core.AbstractRegexpBasedRule;
 import com.adobe.ac.pmd.rules.core.ViolationPriority;
 import com.adobe.ac.pmd.rules.core.thresholded.IThresholdedRule;
+import net.sourceforge.pmd.PropertyDescriptor;
 
 /**
  * @author xagnetti
@@ -61,7 +59,7 @@ public class TooShortVariableRule extends AbstractRegexpBasedRule implements
ITh
     */
    public final int getThreshold()
    {
-      return getIntProperty( propertyDescriptorFor( getThresholdName() ) );
+       return getProperty( (PropertyDescriptor<Integer>) getPropertyDescriptor( getThresholdName()
) );
    }
 
    /*
@@ -138,14 +136,4 @@ public class TooShortVariableRule extends AbstractRegexpBasedRule implements
ITh
       }
       return result;
    }
-
-   /*
-    * (non-Javadoc)
-    * @see net.sourceforge.pmd.CommonAbstractRule#propertiesByName()
-    */
-   @Override
-   protected final Map< String, PropertyDescriptor > propertiesByName()
-   {
-      return getThresholdedRuleProperties( this );
-   }
 }

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3d7976aa/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/switchrules/TooFewBrancheInSwitchStatementRule.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/switchrules/TooFewBrancheInSwitchStatementRule.java
b/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/switchrules/TooFewBrancheInSwitchStatementRule.java
index 2f4aae9..b896f49 100644
--- a/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/switchrules/TooFewBrancheInSwitchStatementRule.java
+++ b/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/main/java/com/adobe/ac/pmd/rules/switchrules/TooFewBrancheInSwitchStatementRule.java
@@ -61,7 +61,7 @@ public class TooFewBrancheInSwitchStatementRule extends AbstractAstFlexRule
impl
     */
    public final int getThreshold()
    {
-      return getIntProperty( propertyDescriptorFor( getThresholdName() ) );
+       return getProperty( (PropertyDescriptor<Integer>) getPropertyDescriptor( getThresholdName()
) );
    }
 
    /*
@@ -87,16 +87,6 @@ public class TooFewBrancheInSwitchStatementRule extends AbstractAstFlexRule
impl
 
    /*
     * (non-Javadoc)
-    * @see net.sourceforge.pmd.CommonAbstractRule#propertiesByName()
-    */
-   @Override
-   protected final Map< String, PropertyDescriptor > propertiesByName()
-   {
-      return getThresholdedRuleProperties( this );
-   }
-
-   /*
-    * (non-Javadoc)
     * @see
     * com.adobe.ac.pmd.rules.core.AbstractAstFlexRule#visitSwitch(com.adobe.
     * ac.pmd.parser.IParserNode)

http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/3d7976aa/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/test/java/com/adobe/ac/pmd/rules/parameterized/ParameterizedRegExpBasedRuleTest.java
----------------------------------------------------------------------
diff --git a/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/test/java/com/adobe/ac/pmd/rules/parameterized/ParameterizedRegExpBasedRuleTest.java
b/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/test/java/com/adobe/ac/pmd/rules/parameterized/ParameterizedRegExpBasedRuleTest.java
index 09d15d4..0fac7e7 100644
--- a/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/test/java/com/adobe/ac/pmd/rules/parameterized/ParameterizedRegExpBasedRuleTest.java
+++ b/FlexPMD/flex-pmd-java/flex-pmd-ruleset/src/test/java/com/adobe/ac/pmd/rules/parameterized/ParameterizedRegExpBasedRuleTest.java
@@ -33,7 +33,8 @@ public class ParameterizedRegExpBasedRuleTest extends AbstractFlexRuleTest
    {
       final ParameterizedRegExpBasedRule rule = new ParameterizedRegExpBasedRule();
 
-      rule.setProperty( rule.propertyDescriptorFor( ParameterizedRegExpBasedRule.PROPERTY_NAME
),
+
+      rule.setProperty( ParameterizedRegExpBasedRule.VIOLATION_SUPPRESS_REGEX_DESCRIPTOR,
                         ".*\\s+Alert.show\\(.*" );
       rule.compilePattern();
       return rule;


Mime
View raw message