public int match(LambdaExpression node, MatchingNodeSet nodeSet) { if (this.pattern.superRefKind != SuperTypeReferencePattern.ONLY_SUPER_INTERFACES) return IMPOSSIBLE_MATCH; nodeSet.mustResolve = true; return nodeSet.addMatch(node, POSSIBLE_MATCH); } //public int match(MethodDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
public int match(ReferenceExpression node, MatchingNodeSet nodeSet) { if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!matchesName(this.pattern.selector, node.selector)) return IMPOSSIBLE_MATCH; if (node.selector != null && Arrays.equals(node.selector, org.eclipse.jdt.internal.compiler.codegen.ConstantPool.Init)) return IMPOSSIBLE_MATCH; // :: new nodeSet.mustResolve = true; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); }
public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ImportReference if (!(node instanceof ImportReference)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, matchLevel((ImportReference) node)); } //public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
public int match(TypeReference node, MatchingNodeSet nodeSet) { // interested in QualifiedTypeReference only if (node instanceof JavadocSingleTypeReference) { char[][] tokens = new char[][] { ((JavadocSingleTypeReference) node).token }; return nodeSet.addMatch(node, matchLevelForTokens(tokens)); } if (!(node instanceof QualifiedTypeReference)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, matchLevelForTokens(((QualifiedTypeReference) node).tokens)); }
public int match(TypeReference node, MatchingNodeSet nodeSet) { if (this.pattern.findReferences) { if (node instanceof SingleTypeReference) { // Type parameter cannot be qualified if (matchesName(this.pattern.name, ((SingleTypeReference) node).token)) { int level = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, level); } } } return IMPOSSIBLE_MATCH; }
public int match(TypeParameter node, MatchingNodeSet nodeSet) { if (this.pattern.findDeclarations) { if (matchesName(this.pattern.name, node.name)) { int level = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, level); } } return IMPOSSIBLE_MATCH; }
public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ImportReference if (!(node instanceof ImportReference)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, matchLevel((ImportReference) node)); } //public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
public int match(ReferenceExpression node, MatchingNodeSet nodeSet) { if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!matchesName(this.pattern.selector, node.selector)) return IMPOSSIBLE_MATCH; nodeSet.mustResolve = true; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); }
public int match(TypeReference node, MatchingNodeSet nodeSet) { // interested in QualifiedTypeReference only if (node instanceof JavadocSingleTypeReference) { char[][] tokens = new char[][] { ((JavadocSingleTypeReference) node).token }; return nodeSet.addMatch(node, matchLevelForTokens(tokens)); } if (!(node instanceof QualifiedTypeReference)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, matchLevelForTokens(((QualifiedTypeReference) node).tokens)); }
@Override public int match(Reference node, MatchingNodeSet nodeSet) { // interested in QualifiedNameReference if (!(node instanceof QualifiedNameReference)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, matchLevelForTokens(((QualifiedNameReference) node).tokens)); } //public int match(TypeDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
@Override public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ImportReference if (!(node instanceof ImportReference)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, matchLevel((ImportReference) node)); } //public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
public int match(TypeParameter node, MatchingNodeSet nodeSet) { if (this.pattern.findDeclarations) { if (matchesName(this.pattern.name, node.name)) { int level = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, level); } } return IMPOSSIBLE_MATCH; }
public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ImportReference if (!(node instanceof ImportReference)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, matchLevel((ImportReference) node)); } //public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
public int match(Reference node, MatchingNodeSet nodeSet) { // interested in QualifiedNameReference if (!(node instanceof QualifiedNameReference)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, matchLevelForTokens(((QualifiedNameReference) node).tokens)); } //public int match(TypeDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
public int match(TypeReference node, MatchingNodeSet nodeSet) { // interested in QualifiedTypeReference only if (node instanceof JavadocSingleTypeReference) { char[][] tokens = new char[][] { ((JavadocSingleTypeReference) node).token }; return nodeSet.addMatch(node, matchLevelForTokens(tokens)); } if (!(node instanceof QualifiedTypeReference)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, matchLevelForTokens(((QualifiedTypeReference) node).tokens)); }
@Override public int match(LambdaExpression node, MatchingNodeSet nodeSet) { if (!this.pattern.findDeclarations) return IMPOSSIBLE_MATCH; if (this.pattern.parameterSimpleNames != null && this.pattern.parameterSimpleNames.length != node.arguments().length) return IMPOSSIBLE_MATCH; nodeSet.mustResolve = true; return nodeSet.addMatch(node, POSSIBLE_MATCH); }
@Override public int match(ReferenceExpression node, MatchingNodeSet nodeSet) { if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!matchesName(this.pattern.selector, node.selector)) return IMPOSSIBLE_MATCH; if (node.selector != null && Arrays.equals(node.selector, org.eclipse.jdt.internal.compiler.codegen.ConstantPool.Init)) return IMPOSSIBLE_MATCH; // :: new nodeSet.mustResolve = true; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); }
@Override public int match(TypeReference node, MatchingNodeSet nodeSet) { // interested in QualifiedTypeReference only if (node instanceof JavadocSingleTypeReference) { char[][] tokens = new char[][] { ((JavadocSingleTypeReference) node).token }; return nodeSet.addMatch(node, matchLevelForTokens(tokens)); } if (!(node instanceof QualifiedTypeReference)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, matchLevelForTokens(((QualifiedTypeReference) node).tokens)); }
public int match(Expression node, MatchingNodeSet nodeSet) { // interested in AllocationExpression if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!(node instanceof AllocationExpression)) return IMPOSSIBLE_MATCH; // constructor name is simple type name AllocationExpression allocation = (AllocationExpression) node; char[][] typeName = allocation.type.getTypeName(); if (this.pattern.declaringSimpleName != null && !matchesName(this.pattern.declaringSimpleName, typeName[typeName.length-1])) return IMPOSSIBLE_MATCH; if (!matchParametersCount(node, allocation.arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } public int match(FieldDeclaration field, MatchingNodeSet nodeSet) {
public int match(Expression node, MatchingNodeSet nodeSet) { // interested in AllocationExpression if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!(node instanceof AllocationExpression)) return IMPOSSIBLE_MATCH; // constructor name is simple type name AllocationExpression allocation = (AllocationExpression) node; char[][] typeName = allocation.type.getTypeName(); if (this.pattern.declaringSimpleName != null && !matchesName(this.pattern.declaringSimpleName, typeName[typeName.length-1])) return IMPOSSIBLE_MATCH; if (!matchParametersCount(node, allocation.arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } public int match(FieldDeclaration field, MatchingNodeSet nodeSet) {