Merge branch 'master' of https://github.com/Up2Go/pmd.git
This commit is contained in:
pmd-apex/src/main/java/net/sourceforge/pmd
cpd
lang/apex
ApexHandler.javaApexLanguageModule.javaApexParser.javaApexParserOptions.java
ast
ASTAnnotation.javaASTAnnotationParameter.javaASTAnonymousClass.javaASTArrayLoadExpression.javaASTArrayStoreExpression.javaASTAssignmentExpression.javaASTBinaryExpression.javaASTBindExpressions.javaASTBlockStatement.javaASTBooleanExpression.javaASTBreakStatement.javaASTBridgeMethodCreator.javaASTCatchBlockStatement.javaASTClassRefExpression.javaASTCompilation.javaASTConstructorPreambleStatement.javaASTContinueStatement.javaASTDmlDeleteStatement.javaASTDmlInsertStatement.javaASTDmlMergeStatement.javaASTDmlUndeleteStatement.javaASTDmlUpdateStatement.javaASTDmlUpsertStatement.javaASTDoLoopStatement.java
@ -4,7 +4,7 @@
|
||||
package net.sourceforge.pmd.cpd;
|
||||
|
||||
public class ApexLanguage extends AbstractLanguage {
|
||||
public ApexLanguage() {
|
||||
super("Apex", "apex", new ApexTokenizer(), ".cls");
|
||||
}
|
||||
public ApexLanguage() {
|
||||
super("Apex", "apex", new ApexTokenizer(), ".cls");
|
||||
}
|
||||
}
|
||||
|
@ -6,22 +6,22 @@ package net.sourceforge.pmd.cpd;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ApexTokenizer extends AbstractTokenizer {
|
||||
public ApexTokenizer() {
|
||||
// setting markers for "string" in apex
|
||||
this.stringToken = new ArrayList<>();
|
||||
this.stringToken.add("\'");
|
||||
this.stringToken.add("\"");
|
||||
public ApexTokenizer() {
|
||||
// setting markers for "string" in apex
|
||||
this.stringToken = new ArrayList<>();
|
||||
this.stringToken.add("\'");
|
||||
this.stringToken.add("\"");
|
||||
|
||||
// setting markers for 'ignorable character' in apex
|
||||
this.ignorableCharacter = new ArrayList<>();
|
||||
this.ignorableCharacter.add(";");
|
||||
// setting markers for 'ignorable character' in apex
|
||||
this.ignorableCharacter = new ArrayList<>();
|
||||
this.ignorableCharacter.add(";");
|
||||
|
||||
// setting markers for 'ignorable string' in apex
|
||||
this.ignorableStmt = new ArrayList<>();
|
||||
// setting markers for 'ignorable string' in apex
|
||||
this.ignorableStmt = new ArrayList<>();
|
||||
|
||||
// strings do indeed span multiple lines in apex
|
||||
this.spanMultipleLinesString = false;
|
||||
// the lines do to end with backslashes
|
||||
this.spanMultipleLinesLineContinuationCharacter = '\\';
|
||||
}
|
||||
// strings do indeed span multiple lines in apex
|
||||
this.spanMultipleLinesString = false;
|
||||
// the lines do to end with backslashes
|
||||
this.spanMultipleLinesLineContinuationCharacter = '\\';
|
||||
}
|
||||
}
|
@ -23,36 +23,36 @@ import net.sourceforge.pmd.lang.rule.RuleViolationFactory;
|
||||
*/
|
||||
public class ApexHandler extends AbstractLanguageVersionHandler {
|
||||
|
||||
@Override
|
||||
public XPathHandler getXPathHandler() {
|
||||
return new AbstractASTXPathHandler() {
|
||||
public void initialize() {
|
||||
}
|
||||
@Override
|
||||
public XPathHandler getXPathHandler() {
|
||||
return new AbstractASTXPathHandler() {
|
||||
public void initialize() {
|
||||
}
|
||||
|
||||
public void initialize(IndependentContext context) {
|
||||
}
|
||||
};
|
||||
}
|
||||
public void initialize(IndependentContext context) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public RuleViolationFactory getRuleViolationFactory() {
|
||||
return ApexRuleViolationFactory.INSTANCE;
|
||||
}
|
||||
public RuleViolationFactory getRuleViolationFactory() {
|
||||
return ApexRuleViolationFactory.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParserOptions getDefaultParserOptions() {
|
||||
return new ApexParserOptions();
|
||||
}
|
||||
@Override
|
||||
public ParserOptions getDefaultParserOptions() {
|
||||
return new ApexParserOptions();
|
||||
}
|
||||
|
||||
public Parser getParser(ParserOptions parserOptions) {
|
||||
return new ApexParser(parserOptions);
|
||||
}
|
||||
public Parser getParser(ParserOptions parserOptions) {
|
||||
return new ApexParser(parserOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VisitorStarter getDumpFacade(Writer writer, String prefix, boolean recurse) {
|
||||
return new VisitorStarter() {
|
||||
public void start(Node rootNode) {
|
||||
new DumpFacade().initializeWith(writer, prefix, recurse, (ApexNode<?>) rootNode);
|
||||
}
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public VisitorStarter getDumpFacade(Writer writer, String prefix, boolean recurse) {
|
||||
return new VisitorStarter() {
|
||||
public void start(Node rootNode) {
|
||||
new DumpFacade().initializeWith(writer, prefix, recurse, (ApexNode<?>) rootNode);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -8,11 +8,11 @@ import net.sourceforge.pmd.lang.apex.rule.ApexRuleChainVisitor;
|
||||
|
||||
public class ApexLanguageModule extends BaseLanguageModule {
|
||||
|
||||
public static final String NAME = "Apex";
|
||||
public static final String TERSE_NAME = "apex";
|
||||
public static final String NAME = "Apex";
|
||||
public static final String TERSE_NAME = "apex";
|
||||
|
||||
public ApexLanguageModule() {
|
||||
super(NAME, null, TERSE_NAME, ApexRuleChainVisitor.class, "cls");
|
||||
addVersion("1.0", new ApexHandler(), true);
|
||||
}
|
||||
public ApexLanguageModule() {
|
||||
super(NAME, null, TERSE_NAME, ApexRuleChainVisitor.class, "cls");
|
||||
addVersion("1.0", new ApexHandler(), true);
|
||||
}
|
||||
}
|
||||
|
@ -16,27 +16,27 @@ import net.sourceforge.pmd.lang.ast.ParseException;
|
||||
* Adapter for the ApexParser.
|
||||
*/
|
||||
public class ApexParser extends AbstractParser {
|
||||
private net.sourceforge.pmd.lang.apex.ast.ApexParser apexParser;
|
||||
private net.sourceforge.pmd.lang.apex.ast.ApexParser apexParser;
|
||||
|
||||
public ApexParser(ParserOptions parserOptions) {
|
||||
super(parserOptions);
|
||||
apexParser = new net.sourceforge.pmd.lang.apex.ast.ApexParser((ApexParserOptions) parserOptions);
|
||||
}
|
||||
public ApexParser(ParserOptions parserOptions) {
|
||||
super(parserOptions);
|
||||
apexParser = new net.sourceforge.pmd.lang.apex.ast.ApexParser((ApexParserOptions) parserOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TokenManager createTokenManager(Reader source) {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public TokenManager createTokenManager(Reader source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canParse() {
|
||||
return true;
|
||||
}
|
||||
public boolean canParse() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public Node parse(String fileName, Reader source) throws ParseException {
|
||||
return apexParser.parse(source);
|
||||
}
|
||||
public Node parse(String fileName, Reader source) throws ParseException {
|
||||
return apexParser.parse(source);
|
||||
}
|
||||
|
||||
public Map<Integer, String> getSuppressMap() {
|
||||
return apexParser.getSuppressMap();
|
||||
}
|
||||
public Map<Integer, String> getSuppressMap() {
|
||||
return apexParser.getSuppressMap();
|
||||
}
|
||||
}
|
||||
|
@ -8,25 +8,25 @@ import net.sourceforge.pmd.util.StringUtil;
|
||||
|
||||
public class ApexParserOptions extends ParserOptions {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + (1237);
|
||||
result = prime * result + (1237);
|
||||
result = prime * result;
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = super.hashCode();
|
||||
result = prime * result + (1237);
|
||||
result = prime * result + (1237);
|
||||
result = prime * result;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final ApexParserOptions that = (ApexParserOptions) obj;
|
||||
return StringUtil.isSame(this.suppressMarker, that.suppressMarker, false, false, false);
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null || getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final ApexParserOptions that = (ApexParserOptions) obj;
|
||||
return StringUtil.isSame(this.suppressMarker, that.suppressMarker, false, false, false);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.modifier.Annotation;
|
||||
|
||||
public class ASTAnnotation extends AbstractApexNode<Annotation> {
|
||||
|
||||
public ASTAnnotation(Annotation annotation) {
|
||||
super(annotation);
|
||||
}
|
||||
public ASTAnnotation(Annotation annotation) {
|
||||
super(annotation);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import apex.jorje.semantic.ast.modifier.AnnotationParameter;
|
||||
|
||||
public class ASTAnnotationParameter extends AbstractApexNode<AnnotationParameter> {
|
||||
|
||||
public ASTAnnotationParameter(AnnotationParameter annotationParameter) {
|
||||
super(annotationParameter);
|
||||
}
|
||||
public ASTAnnotationParameter(AnnotationParameter annotationParameter) {
|
||||
super(annotationParameter);
|
||||
}
|
||||
}
|
@ -8,12 +8,12 @@ import net.sourceforge.pmd.lang.ast.RootNode;
|
||||
|
||||
public class ASTAnonymousClass extends AbstractApexNode<AnonymousClass> implements RootNode {
|
||||
|
||||
public ASTAnonymousClass(AnonymousClass anonymousClass) {
|
||||
super(anonymousClass);
|
||||
}
|
||||
public ASTAnonymousClass(AnonymousClass anonymousClass) {
|
||||
super(anonymousClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getImage() {
|
||||
return node.getClass().getName();
|
||||
}
|
||||
@Override
|
||||
public String getImage() {
|
||||
return node.getClass().getName();
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import apex.jorje.semantic.ast.expression.ArrayLoadExpression;
|
||||
|
||||
public class ASTArrayLoadExpression extends AbstractApexNode<ArrayLoadExpression> {
|
||||
|
||||
public ASTArrayLoadExpression(ArrayLoadExpression arrayLoadExpression) {
|
||||
super(arrayLoadExpression);
|
||||
}
|
||||
public ASTArrayLoadExpression(ArrayLoadExpression arrayLoadExpression) {
|
||||
super(arrayLoadExpression);
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ import apex.jorje.semantic.ast.expression.ArrayStoreExpression;
|
||||
|
||||
public class ASTArrayStoreExpression extends AbstractApexNode<ArrayStoreExpression> {
|
||||
|
||||
public ASTArrayStoreExpression(ArrayStoreExpression arrayStoreExpression) {
|
||||
super(arrayStoreExpression);
|
||||
}
|
||||
public ASTArrayStoreExpression(ArrayStoreExpression arrayStoreExpression) {
|
||||
super(arrayStoreExpression);
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ import apex.jorje.semantic.ast.expression.AssignmentExpression;
|
||||
|
||||
public class ASTAssignmentExpression extends AbstractApexNode<AssignmentExpression> {
|
||||
|
||||
public ASTAssignmentExpression(AssignmentExpression assignmentExpression) {
|
||||
super(assignmentExpression);
|
||||
}
|
||||
public ASTAssignmentExpression(AssignmentExpression assignmentExpression) {
|
||||
super(assignmentExpression);
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ import apex.jorje.semantic.ast.expression.BinaryExpression;
|
||||
|
||||
public class ASTBinaryExpression extends AbstractApexNode<BinaryExpression> {
|
||||
|
||||
public ASTBinaryExpression(BinaryExpression binaryExpression) {
|
||||
super(binaryExpression);
|
||||
}
|
||||
public ASTBinaryExpression(BinaryExpression binaryExpression) {
|
||||
super(binaryExpression);
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ import apex.jorje.semantic.ast.expression.BindExpressions;
|
||||
|
||||
public class ASTBindExpressions extends AbstractApexNode<BindExpressions> {
|
||||
|
||||
public ASTBindExpressions(BindExpressions bindExpressions) {
|
||||
super(bindExpressions);
|
||||
}
|
||||
public ASTBindExpressions(BindExpressions bindExpressions) {
|
||||
super(bindExpressions);
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.BlockStatement;
|
||||
|
||||
public class ASTBlockStatement extends AbstractApexNode<BlockStatement> {
|
||||
|
||||
public ASTBlockStatement(BlockStatement blockStatement) {
|
||||
super(blockStatement);
|
||||
}
|
||||
public ASTBlockStatement(BlockStatement blockStatement) {
|
||||
super(blockStatement);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import apex.jorje.semantic.ast.expression.BooleanExpression;
|
||||
|
||||
public class ASTBooleanExpression extends AbstractApexNode<BooleanExpression> {
|
||||
|
||||
public ASTBooleanExpression(BooleanExpression booleanExpression) {
|
||||
super(booleanExpression);
|
||||
}
|
||||
public ASTBooleanExpression(BooleanExpression booleanExpression) {
|
||||
super(booleanExpression);
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.BreakStatement;
|
||||
|
||||
public class ASTBreakStatement extends AbstractApexNode<BreakStatement> {
|
||||
|
||||
public ASTBreakStatement(BreakStatement breakStatement) {
|
||||
super(breakStatement);
|
||||
}
|
||||
public ASTBreakStatement(BreakStatement breakStatement) {
|
||||
super(breakStatement);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.member.bridge.BridgeMethodCreator;
|
||||
|
||||
public class ASTBridgeMethodCreator extends AbstractApexNode<BridgeMethodCreator> {
|
||||
|
||||
public ASTBridgeMethodCreator(BridgeMethodCreator bridgeMethodCreator) {
|
||||
super(bridgeMethodCreator);
|
||||
}
|
||||
public ASTBridgeMethodCreator(BridgeMethodCreator bridgeMethodCreator) {
|
||||
super(bridgeMethodCreator);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.CatchBlockStatement;
|
||||
|
||||
public class ASTCatchBlockStatement extends AbstractApexNode<CatchBlockStatement> {
|
||||
|
||||
public ASTCatchBlockStatement(CatchBlockStatement catchBlockStatement) {
|
||||
super(catchBlockStatement);
|
||||
}
|
||||
public ASTCatchBlockStatement(CatchBlockStatement catchBlockStatement) {
|
||||
super(catchBlockStatement);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import apex.jorje.semantic.ast.expression.ClassRefExpression;
|
||||
|
||||
public class ASTClassRefExpression extends AbstractApexNode<ClassRefExpression> {
|
||||
|
||||
public ASTClassRefExpression(ClassRefExpression classRefExpression) {
|
||||
super(classRefExpression);
|
||||
}
|
||||
public ASTClassRefExpression(ClassRefExpression classRefExpression) {
|
||||
super(classRefExpression);
|
||||
}
|
||||
}
|
@ -7,12 +7,12 @@ import apex.jorje.semantic.ast.compilation.Compilation;
|
||||
import net.sourceforge.pmd.lang.ast.RootNode;
|
||||
|
||||
public class ASTCompilation extends AbstractApexNode<Compilation> implements RootNode {
|
||||
public ASTCompilation(Compilation classOrInterface) {
|
||||
super(classOrInterface);
|
||||
}
|
||||
public ASTCompilation(Compilation classOrInterface) {
|
||||
super(classOrInterface);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getImage() {
|
||||
return node.getClass().getName();
|
||||
}
|
||||
@Override
|
||||
public String getImage() {
|
||||
return node.getClass().getName();
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import apex.jorje.semantic.ast.statement.ConstructorPreambleStatement;
|
||||
|
||||
public class ASTConstructorPreambleStatement extends AbstractApexNode<ConstructorPreambleStatement> {
|
||||
|
||||
public ASTConstructorPreambleStatement(ConstructorPreambleStatement constructorPreambleStatement) {
|
||||
super(constructorPreambleStatement);
|
||||
}
|
||||
public ASTConstructorPreambleStatement(ConstructorPreambleStatement constructorPreambleStatement) {
|
||||
super(constructorPreambleStatement);
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.ContinueStatement;
|
||||
|
||||
public class ASTContinueStatement extends AbstractApexNode<ContinueStatement> {
|
||||
|
||||
public ASTContinueStatement(ContinueStatement continueStatement) {
|
||||
super(continueStatement);
|
||||
}
|
||||
public ASTContinueStatement(ContinueStatement continueStatement) {
|
||||
super(continueStatement);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.DmlDeleteStatement;
|
||||
|
||||
public class ASTDmlDeleteStatement extends AbstractApexNode<DmlDeleteStatement> {
|
||||
|
||||
public ASTDmlDeleteStatement(DmlDeleteStatement dmlDeleteStatement) {
|
||||
super(dmlDeleteStatement);
|
||||
}
|
||||
public ASTDmlDeleteStatement(DmlDeleteStatement dmlDeleteStatement) {
|
||||
super(dmlDeleteStatement);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.DmlInsertStatement;
|
||||
|
||||
public class ASTDmlInsertStatement extends AbstractApexNode<DmlInsertStatement> {
|
||||
|
||||
public ASTDmlInsertStatement(DmlInsertStatement dmlInsertStatement) {
|
||||
super(dmlInsertStatement);
|
||||
}
|
||||
public ASTDmlInsertStatement(DmlInsertStatement dmlInsertStatement) {
|
||||
super(dmlInsertStatement);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.DmlMergeStatement;
|
||||
|
||||
public class ASTDmlMergeStatement extends AbstractApexNode<DmlMergeStatement> {
|
||||
|
||||
public ASTDmlMergeStatement(DmlMergeStatement dmlMergeStatement) {
|
||||
super(dmlMergeStatement);
|
||||
}
|
||||
public ASTDmlMergeStatement(DmlMergeStatement dmlMergeStatement) {
|
||||
super(dmlMergeStatement);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.DmlUndeleteStatement;
|
||||
|
||||
public class ASTDmlUndeleteStatement extends AbstractApexNode<DmlUndeleteStatement> {
|
||||
|
||||
public ASTDmlUndeleteStatement(DmlUndeleteStatement dmlUndeleteStatement) {
|
||||
super(dmlUndeleteStatement);
|
||||
}
|
||||
public ASTDmlUndeleteStatement(DmlUndeleteStatement dmlUndeleteStatement) {
|
||||
super(dmlUndeleteStatement);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.DmlUpdateStatement;
|
||||
|
||||
public class ASTDmlUpdateStatement extends AbstractApexNode<DmlUpdateStatement> {
|
||||
|
||||
public ASTDmlUpdateStatement(DmlUpdateStatement dmlUpdateStatement) {
|
||||
super(dmlUpdateStatement);
|
||||
}
|
||||
public ASTDmlUpdateStatement(DmlUpdateStatement dmlUpdateStatement) {
|
||||
super(dmlUpdateStatement);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.DmlUpsertStatement;
|
||||
|
||||
public class ASTDmlUpsertStatement extends AbstractApexNode<DmlUpsertStatement> {
|
||||
|
||||
public ASTDmlUpsertStatement(DmlUpsertStatement dmlUpsertStatement) {
|
||||
super(dmlUpsertStatement);
|
||||
}
|
||||
public ASTDmlUpsertStatement(DmlUpsertStatement dmlUpsertStatement) {
|
||||
super(dmlUpsertStatement);
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import apex.jorje.semantic.ast.statement.DoLoopStatement;
|
||||
|
||||
public class ASTDoLoopStatement extends AbstractApexNode<DoLoopStatement> {
|
||||
|
||||
public ASTDoLoopStatement(DoLoopStatement doLoopStatement) {
|
||||
super(doLoopStatement);
|
||||
}
|
||||
public ASTDoLoopStatement(DoLoopStatement doLoopStatement) {
|
||||
super(doLoopStatement);
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user