[vm] Refactor checkstyle warnings and suppressions

This commit is contained in:
Andreas Dangel
2020-03-13 08:59:54 +01:00
parent 68a93e13c4
commit e685c6aade
24 changed files with 38 additions and 46 deletions

View File

@ -1,12 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
<suppress files="[\\/]generated-sources[\\/]" checks="[a-zA-Z0-9]*"/>
<!-- The velocity language is under the Apache License. -->
<suppress checks="RegexpHeaderCheck" files="net[\\/]sourceforge[\\/]pmd[\\/]lang[\\/]vm[\\/].*"/>
<suppress checks="ModifiedControlVariable" files="src[\\/]main[\\/]java[\\/]net[\\/]sourceforge[\\/]pmd[\\/]lang[\\/]vm[\\/]ast[\\/]NodeUtils\.java"/>
<suppress checks="RegexpHeader" files="ast[\\/](ASTDirective|AbstractVmNode|ASTDivNode|ASTSubtractNode|NodeUtils|ASTMulNode|ASTMethod|ASTStringLiteral|ASTModNode|ASTEscape|ASTReference|ASTAddNode|ASTMathNode)\.java"/>
</suppressions>

View File

@ -21,10 +21,9 @@ package net.sourceforge.pmd.lang.vm.ast;
*/
/**
* Handles number addition of nodes.<br>
* <br>
* Handles number addition of nodes.
*
* Please look at the Parser.jjt file which is what controls the generation of
* <p>Please look at the Parser.jjt file which is what controls the generation of
* this class.
*
* @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>

View File

@ -27,9 +27,9 @@ import java.util.Set;
/**
* This class is responsible for handling the pluggable directives in VTL.
*
* For example : #foreach()
* <p>For example : #foreach()
*
* Please look at the Parser.jjt file which is what controls the generation of
* <p>Please look at the Parser.jjt file which is what controls the generation of
* this class.
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>

View File

@ -21,10 +21,9 @@ package net.sourceforge.pmd.lang.vm.ast;
*/
/**
* Handles number division of nodes<br>
* <br>
* Handles number division of nodes
*
* Please look at the Parser.jjt file which is what controls the generation of
* <p>Please look at the Parser.jjt file which is what controls the generation of
* this class.
*
* @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>

View File

@ -23,7 +23,7 @@ package net.sourceforge.pmd.lang.vm.ast;
/**
* This class is responsible for handling Escapes in VTL.
*
* Please look at the Parser.jjt file which is what controls the generation of
* <p>Please look at the Parser.jjt file which is what controls the generation of
* this class.
*
* @author <a href="mailto:geirm@optonline.net">Geir Magnusson Jr.</a>
@ -31,7 +31,7 @@ package net.sourceforge.pmd.lang.vm.ast;
*/
public final class ASTEscape extends AbstractVmNode {
/** Used by the parser */
/** Used by the parser. */
private String val;

View File

@ -20,10 +20,9 @@ package net.sourceforge.pmd.lang.vm.ast;
*/
/**
* Helps handle math<br>
* <br>
* Helps handle math
*
* Please look at the Parser.jjt file which is what controls the generation of
* <p>Please look at the Parser.jjt file which is what controls the generation of
* this class.
*
* @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>

View File

@ -23,13 +23,12 @@ package net.sourceforge.pmd.lang.vm.ast;
/**
* ASTMethod.java
*
* Method support for references : $foo.method()
*
* NOTE :
* <p>Method support for references : $foo.method()
*
* <p>NOTE :
* introspection is now done at render time.
*
* Please look at the Parser.jjt file which is what controls the generation of
* <p>Please look at the Parser.jjt file which is what controls the generation of
* this class.
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>

View File

@ -21,10 +21,9 @@ package net.sourceforge.pmd.lang.vm.ast;
*/
/**
* Handles modulus division<br>
* <br>
* Handles modulus division
*
* Please look at the Parser.jjt file which is what controls the generation of
* <p>Please look at the Parser.jjt file which is what controls the generation of
* this class.
*
* @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>

View File

@ -21,10 +21,9 @@ package net.sourceforge.pmd.lang.vm.ast;
*/
/**
* Handles multiplication<br>
* <br>
* Handles multiplication
*
* Please look at the Parser.jjt file which is what controls the generation of
* <p>Please look at the Parser.jjt file which is what controls the generation of
* this class.
*
* @author <a href="mailto:wglass@forio.com">Will Glass-Husain</a>

View File

@ -23,7 +23,7 @@ package net.sourceforge.pmd.lang.vm.ast;
/**
* This class is responsible for handling the references in VTL ($foo).
*
* Please look at the Parser.jjt file which is what controls the generation of
* <p>Please look at the Parser.jjt file which is what controls the generation of
* this class.
*
* @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
@ -47,7 +47,7 @@ public final class ASTReference extends AbstractVmNode {
}
/**
* Returns the 'root string', the reference key
* Returns the 'root string', the reference key.
*
* @return the root string.
*/
@ -61,7 +61,7 @@ public final class ASTReference extends AbstractVmNode {
* literal of the calling arg to make it work nicely when calling arg is
* null. It seems a bit much, but does keep things consistant.
*
* Note, you can only set the literal once...
* <p>Note, you can only set the literal once...
*
* @param literal
* String to render to when null

View File

@ -48,7 +48,7 @@ abstract class AbstractVmNode extends AbstractJjtreeNode<VmNode> implements VmNo
public String literal() {
// if we have only one string, just return it and avoid
// buffer allocation. VELOCITY-606
if (getFirstToken() != null && firstToken.equals(getLastToken())) {
if (getFirstToken() != null && getFirstToken().equals(getLastToken())) {
return NodeUtils.tokenLiteral(getFirstToken());
}

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,11 +1,11 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd;
/**
* Test velocity's rulesets
* Test velocity's rulesets.
*/
public class RuleSetFactoryTest extends AbstractRuleSetFactoryTest {
// no additional tests yet

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/

View File

@ -1,4 +1,4 @@
/**
/*
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/