From 49b2fb2e6ad951b159d9625f6370a7c77c14151a Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 27 Feb 2017 13:44:26 -0800 Subject: [PATCH] Refactoring --- .../pmd/lang/vf/rule/VfRuleChainVisitor.java | 6 ++--- pmd-visualforce/src/site/markdown/index.md | 4 +-- pmd-visualforce/src/site/site.pre.xml | 25 +++++++++---------- .../sourceforge/pmd/lang/vf/VfParserTest.java | 4 +-- .../pmd/lang/vf/ast/AbstractVfNodesTest.java | 2 +- .../pmd/lang/vf/ast/VfPageStyleTest.java | 2 +- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/VfRuleChainVisitor.java b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/VfRuleChainVisitor.java index edbee28caa..86a05e63b4 100644 --- a/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/VfRuleChainVisitor.java +++ b/pmd-visualforce/src/main/java/net/sourceforge/pmd/lang/vf/rule/VfRuleChainVisitor.java @@ -19,15 +19,15 @@ import net.sourceforge.pmd.lang.vf.ast.VfParserVisitorAdapter; public class VfRuleChainVisitor extends AbstractRuleChainVisitor { protected void indexNodes(List nodes, RuleContext ctx) { - VfParserVisitor jspParserVisitor = new VfParserVisitorAdapter(); + VfParserVisitor vfParserVisitor = new VfParserVisitorAdapter(); for (int i = 0; i < nodes.size(); i++) { - jspParserVisitor.visit((ASTCompilationUnit) nodes.get(i), ctx); + vfParserVisitor.visit((ASTCompilationUnit) nodes.get(i), ctx); } } protected void visit(Rule rule, Node node, RuleContext ctx) { - // Rule better either be a JspParserVisitor, or a XPathRule + // Rule better either be a vfParserVisitor, or a XPathRule if (rule instanceof VfParserVisitor) { ((VfNode) node).jjtAccept((VfParserVisitor) rule, ctx); } else { diff --git a/pmd-visualforce/src/site/markdown/index.md b/pmd-visualforce/src/site/markdown/index.md index d8112908ac..5f70549cd2 100644 --- a/pmd-visualforce/src/site/markdown/index.md +++ b/pmd-visualforce/src/site/markdown/index.md @@ -1,5 +1,5 @@ -# PMD JSP +# PMD VF -Contains the PMD implementation to support Java Server Pages. +Contains the PMD implementation to support Salesforce VisualForce. For the available rules, see rulesets index page. diff --git a/pmd-visualforce/src/site/site.pre.xml b/pmd-visualforce/src/site/site.pre.xml index f012ef958a..6ae7aa9380 100644 --- a/pmd-visualforce/src/site/site.pre.xml +++ b/pmd-visualforce/src/site/site.pre.xml @@ -1,23 +1,22 @@ - + - - + + - + - + - + - + - + diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/VfParserTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/VfParserTest.java index 3a04184e84..3e40cc7e44 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/VfParserTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/VfParserTest.java @@ -39,9 +39,9 @@ public class VfParserTest { } private Node parse(String code) { - LanguageVersionHandler jspLang = LanguageRegistry.getLanguage(VfLanguageModule.NAME).getDefaultVersion() + LanguageVersionHandler vfLang = LanguageRegistry.getLanguage(VfLanguageModule.NAME).getDefaultVersion() .getLanguageVersionHandler(); - Parser parser = jspLang.getParser(jspLang.getDefaultParserOptions()); + Parser parser = vfLang.getParser(vfLang.getDefaultParserOptions()); Node node = parser.parse(null, new StringReader(code)); return node; } diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/AbstractVfNodesTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/AbstractVfNodesTest.java index 97a5319bd7..faaceb1bdf 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/AbstractVfNodesTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/AbstractVfNodesTest.java @@ -21,7 +21,7 @@ public abstract class AbstractVfNodesTest { } /** - * Run the JSP parser on the source, and return the nodes of type clazz. + * Run the VF parser on the source, and return the nodes of type clazz. * * @param clazz * @param source diff --git a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfPageStyleTest.java b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfPageStyleTest.java index 2c584e594d..9295a8945d 100644 --- a/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfPageStyleTest.java +++ b/pmd-visualforce/src/test/java/net/sourceforge/pmd/lang/vf/ast/VfPageStyleTest.java @@ -52,7 +52,7 @@ public class VfPageStyleTest extends AbstractVfNodesTest { assertEquals("Correct expression content expected!", "\"'vf'\"", literal.getImage()); } - private static final String VF_EL_EXPRESSION = "Hello {!myBean.get(\"{! World }\") } .jsp"; + private static final String VF_EL_EXPRESSION = "Hello {!myBean.get(\"{! World }\") } .vf"; private static final String VF_EL_EXPRESSION_IN_ATTRIBUTE = " ";