@Override public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ExplicitConstructorCall if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!(node instanceof ExplicitConstructorCall)) return IMPOSSIBLE_MATCH; if (!matchParametersCount(node, ((ExplicitConstructorCall) node).arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } @Override
public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ExplicitConstructorCall if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!(node instanceof ExplicitConstructorCall)) return IMPOSSIBLE_MATCH; if (!matchParametersCount(node, ((ExplicitConstructorCall) node).arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) {
public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ExplicitConstructorCall if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!(node instanceof ExplicitConstructorCall)) return IMPOSSIBLE_MATCH; if (!matchParametersCount(node, ((ExplicitConstructorCall) node).arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) {
public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ExplicitConstructorCall if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!(node instanceof ExplicitConstructorCall)) return IMPOSSIBLE_MATCH; if (!matchParametersCount(node, ((ExplicitConstructorCall) node).arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) {
public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ExplicitConstructorCall if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!(node instanceof ExplicitConstructorCall)) return IMPOSSIBLE_MATCH; if (!matchParametersCount(node, ((ExplicitConstructorCall) node).arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } public int match(ConstructorDeclaration node, MatchingNodeSet nodeSet) {
public int match(ASTNode node, MatchingNodeSet nodeSet) { // interested in ExplicitConstructorCall if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; if (!(node instanceof ExplicitConstructorCall)) return IMPOSSIBLE_MATCH; if (!matchParametersCount(node, ((ExplicitConstructorCall) node).arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } public int match(ConstructorDeclaration node, 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) {
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) {
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(FieldDeclaration field, MatchingNodeSet nodeSet) { if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; // look only for enum constant if (field.type != null || !(field.initialization instanceof AllocationExpression)) return IMPOSSIBLE_MATCH; AllocationExpression allocation = (AllocationExpression) field.initialization; if (field.binding != null && field.binding.declaringClass != null) { if (this.pattern.declaringSimpleName != null && !matchesName(this.pattern.declaringSimpleName, field.binding.declaringClass.sourceName())) return IMPOSSIBLE_MATCH; } if (!matchParametersCount(field, allocation.arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(field, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } //public int match(MethodDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
@Override 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); } @Override
public int match(FieldDeclaration field, MatchingNodeSet nodeSet) { if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; // look only for enum constant if (field.type != null || !(field.initialization instanceof AllocationExpression)) return IMPOSSIBLE_MATCH; AllocationExpression allocation = (AllocationExpression) field.initialization; if (field.binding != null && field.binding.declaringClass != null) { if (this.pattern.declaringSimpleName != null && !matchesName(this.pattern.declaringSimpleName, field.binding.declaringClass.sourceName())) return IMPOSSIBLE_MATCH; } if (!matchParametersCount(field, allocation.arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(field, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } //public int match(MethodDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
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(FieldDeclaration field, MatchingNodeSet nodeSet) { if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; // look only for enum constant if (field.type != null || !(field.initialization instanceof AllocationExpression)) return IMPOSSIBLE_MATCH; AllocationExpression allocation = (AllocationExpression) field.initialization; if (field.binding != null && field.binding.declaringClass != null) { if (this.pattern.declaringSimpleName != null && !matchesName(this.pattern.declaringSimpleName, field.binding.declaringClass.sourceName())) return IMPOSSIBLE_MATCH; } if (!matchParametersCount(field, allocation.arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(field, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } //public int match(MethodDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
public int match(FieldDeclaration field, MatchingNodeSet nodeSet) { if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; // look only for enum constant if (field.type != null || !(field.initialization instanceof AllocationExpression)) return IMPOSSIBLE_MATCH; AllocationExpression allocation = (AllocationExpression) field.initialization; if (field.binding != null && field.binding.declaringClass != null) { if (this.pattern.declaringSimpleName != null && !matchesName(this.pattern.declaringSimpleName, field.binding.declaringClass.sourceName())) return IMPOSSIBLE_MATCH; } if (!matchParametersCount(field, allocation.arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(field, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } //public int match(MethodDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
public int match(FieldDeclaration field, MatchingNodeSet nodeSet) { if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; // look only for enum constant if (field.type != null || !(field.initialization instanceof AllocationExpression)) return IMPOSSIBLE_MATCH; AllocationExpression allocation = (AllocationExpression) field.initialization; if (field.binding != null && field.binding.declaringClass != null) { if (this.pattern.declaringSimpleName != null && !matchesName(this.pattern.declaringSimpleName, field.binding.declaringClass.sourceName())) return IMPOSSIBLE_MATCH; } if (!matchParametersCount(field, allocation.arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(field, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } //public int match(MethodDeclaration node, MatchingNodeSet nodeSet) - SKIP IT
@Override public int match(FieldDeclaration field, MatchingNodeSet nodeSet) { if (!this.pattern.findReferences) return IMPOSSIBLE_MATCH; // look only for enum constant if (field.type != null || !(field.initialization instanceof AllocationExpression)) return IMPOSSIBLE_MATCH; AllocationExpression allocation = (AllocationExpression) field.initialization; if (field.binding != null && field.binding.declaringClass != null) { if (this.pattern.declaringSimpleName != null && !matchesName(this.pattern.declaringSimpleName, field.binding.declaringClass.sourceName())) return IMPOSSIBLE_MATCH; } if (!matchParametersCount(field, allocation.arguments)) return IMPOSSIBLE_MATCH; return nodeSet.addMatch(field, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); } //public int match(MethodDeclaration node, MatchingNodeSet nodeSet) - SKIP IT