Fix PMD dogfood: UncommentedEmptyMethodBody, SimplifyBooleanReturns,
UnnecessaryLocalBeforeReturn, OptimizableToArrayCall, ClassWithOnlyPrivateConstructorsShouldBeFinal, UseLocaleWithCaseConversions, NonStaticInitializer, UseCollectionIsEmpty
This commit is contained in:
@ -12,14 +12,12 @@ import net.sourceforge.pmd.lang.ParserOptions;
|
||||
import net.sourceforge.pmd.lang.VisitorStarter;
|
||||
import net.sourceforge.pmd.lang.XPathHandler;
|
||||
import net.sourceforge.pmd.lang.ast.Node;
|
||||
import net.sourceforge.pmd.lang.ast.xpath.AbstractASTXPathHandler;
|
||||
import net.sourceforge.pmd.lang.ast.xpath.DefaultASTXPathHandler;
|
||||
import net.sourceforge.pmd.lang.ecmascript.ast.DumpFacade;
|
||||
import net.sourceforge.pmd.lang.ecmascript.ast.EcmascriptNode;
|
||||
import net.sourceforge.pmd.lang.ecmascript.rule.EcmascriptRuleViolationFactory;
|
||||
import net.sourceforge.pmd.lang.rule.RuleViolationFactory;
|
||||
|
||||
import net.sf.saxon.sxpath.IndependentContext;
|
||||
|
||||
/**
|
||||
* Implementation of LanguageVersionHandler for the ECMAScript Version 3.
|
||||
*/
|
||||
@ -27,13 +25,7 @@ public class Ecmascript3Handler extends AbstractLanguageVersionHandler {
|
||||
|
||||
@Override
|
||||
public XPathHandler getXPathHandler() {
|
||||
return new AbstractASTXPathHandler() {
|
||||
public void initialize() {
|
||||
}
|
||||
|
||||
public void initialize(IndependentContext context) {
|
||||
}
|
||||
};
|
||||
return new DefaultASTXPathHandler();
|
||||
}
|
||||
|
||||
public RuleViolationFactory getRuleViolationFactory() {
|
||||
|
@ -4,13 +4,15 @@
|
||||
|
||||
package net.sourceforge.pmd.lang.ecmascript.ast;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.mozilla.javascript.Token;
|
||||
import org.mozilla.javascript.ast.KeywordLiteral;
|
||||
|
||||
public class ASTKeywordLiteral extends AbstractEcmascriptNode<KeywordLiteral> {
|
||||
public ASTKeywordLiteral(KeywordLiteral keywordLiteral) {
|
||||
super(keywordLiteral);
|
||||
super.setImage(Token.typeToName(keywordLiteral.getType()).toLowerCase());
|
||||
super.setImage(Token.typeToName(keywordLiteral.getType()).toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,13 +4,15 @@
|
||||
|
||||
package net.sourceforge.pmd.lang.ecmascript.ast;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.mozilla.javascript.Token;
|
||||
import org.mozilla.javascript.ast.VariableDeclaration;
|
||||
|
||||
public class ASTVariableDeclaration extends AbstractEcmascriptNode<VariableDeclaration> {
|
||||
public ASTVariableDeclaration(VariableDeclaration variableDeclaration) {
|
||||
super(variableDeclaration);
|
||||
super.setImage(Token.typeToName(variableDeclaration.getType()).toLowerCase());
|
||||
super.setImage(Token.typeToName(variableDeclaration.getType()).toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user