@Override public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes return (this.pattern.readAccess || this.pattern.fineGrain != 0) ? matchReference(node, nodeSet, false) : IMPOSSIBLE_MATCH; } protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) {
public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes return (this.pattern.readAccess || this.pattern.fineGrain != 0) ? matchReference(node, nodeSet, false) : IMPOSSIBLE_MATCH; } protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) {
public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes return (this.pattern.readAccess || this.pattern.fineGrain != 0) ? matchReference(node, nodeSet, false) : IMPOSSIBLE_MATCH; } protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) {
public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes return (this.pattern.readAccess || this.pattern.fineGrain != 0) ? matchReference(node, nodeSet, false) : IMPOSSIBLE_MATCH; } protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) {
public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes return (this.pattern.readAccess || this.pattern.fineGrain != 0) ? matchReference(node, nodeSet, false) : IMPOSSIBLE_MATCH; } protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) {
public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes return (this.pattern.readAccess || this.pattern.fineGrain != 0) ? matchReference(node, nodeSet, false) : IMPOSSIBLE_MATCH; } protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) {
@Override protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) { if (node instanceof FieldReference) { if (matchesName(this.pattern.name, ((FieldReference) node).token)) return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); return IMPOSSIBLE_MATCH; } return super.matchReference(node, nodeSet, writeOnlyAccess); } @Override
protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) { if (node instanceof FieldReference) { if (matchesName(this.pattern.name, ((FieldReference) node).token)) return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); return IMPOSSIBLE_MATCH; } return super.matchReference(node, nodeSet, writeOnlyAccess); } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) { if (node instanceof FieldReference) { if (matchesName(this.pattern.name, ((FieldReference) node).token)) return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); return IMPOSSIBLE_MATCH; } return super.matchReference(node, nodeSet, writeOnlyAccess); } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) { if (node instanceof FieldReference) { if (matchesName(this.pattern.name, ((FieldReference) node).token)) return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); return IMPOSSIBLE_MATCH; } return super.matchReference(node, nodeSet, writeOnlyAccess); } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) { if (node instanceof FieldReference) { if (matchesName(this.pattern.name, ((FieldReference) node).token)) return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); return IMPOSSIBLE_MATCH; } return super.matchReference(node, nodeSet, writeOnlyAccess); } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
protected int matchReference(Reference node, MatchingNodeSet nodeSet, boolean writeOnlyAccess) { if (node instanceof FieldReference) { if (matchesName(this.pattern.name, ((FieldReference) node).token)) return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH); return IMPOSSIBLE_MATCH; } return super.matchReference(node, nodeSet, writeOnlyAccess); } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
@Override public int match(Expression node, MatchingNodeSet nodeSet) { // interested in Assignment if (this.pattern.writeAccess) { if (this.pattern.readAccess) return IMPOSSIBLE_MATCH; // already checked the lhs in match(Reference...) before we reached here if (node instanceof Assignment) { Expression lhs = ((Assignment) node).lhs; if (lhs instanceof Reference) return matchReference((Reference) lhs, nodeSet, true); } } else if (this.pattern.readAccess || this.pattern.fineGrain != 0) { if (node instanceof Assignment && !(node instanceof CompoundAssignment)) { // the lhs of a simple assignment may be added in match(Reference...) before we reach here // for example, the fieldRef to 'this.x' in the statement this.x = x; is not considered a readAccess char[] lastToken = null; Expression lhs = ((Assignment) node).lhs; if (lhs instanceof QualifiedNameReference) { char[][] tokens = ((QualifiedNameReference)lhs).tokens; lastToken = tokens[tokens.length-1]; } if (lastToken == null || matchesName(this.pattern.name, lastToken)) { nodeSet.removePossibleMatch(lhs); nodeSet.removeTrustedMatch(lhs); } } } return IMPOSSIBLE_MATCH; } @Override
public int match(Expression node, MatchingNodeSet nodeSet) { // interested in Assignment if (this.pattern.writeAccess) { if (this.pattern.readAccess) return IMPOSSIBLE_MATCH; // already checked the lhs in match(Reference...) before we reached here if (node instanceof Assignment) { Expression lhs = ((Assignment) node).lhs; if (lhs instanceof Reference) return matchReference((Reference) lhs, nodeSet, true); } } else if (this.pattern.readAccess || this.pattern.fineGrain != 0) { if (node instanceof Assignment && !(node instanceof CompoundAssignment)) { // the lhs of a simple assignment may be added in match(Reference...) before we reach here // for example, the fieldRef to 'this.x' in the statement this.x = x; is not considered a readAccess char[] lastToken = null; Expression lhs = ((Assignment) node).lhs; if (lhs instanceof QualifiedNameReference) { char[][] tokens = ((QualifiedNameReference)lhs).tokens; lastToken = tokens[tokens.length-1]; } if (lastToken == null || matchesName(this.pattern.name, lastToken)) { nodeSet.removePossibleMatch(lhs); nodeSet.removeTrustedMatch(lhs); } } } return IMPOSSIBLE_MATCH; } public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes
public int match(Expression node, MatchingNodeSet nodeSet) { // interested in Assignment if (this.pattern.writeAccess) { if (this.pattern.readAccess) return IMPOSSIBLE_MATCH; // already checked the lhs in match(Reference...) before we reached here if (node instanceof Assignment) { Expression lhs = ((Assignment) node).lhs; if (lhs instanceof Reference) return matchReference((Reference) lhs, nodeSet, true); } } else if (this.pattern.readAccess || this.pattern.fineGrain != 0) { if (node instanceof Assignment && !(node instanceof CompoundAssignment)) { // the lhs of a simple assignment may be added in match(Reference...) before we reach here // for example, the fieldRef to 'this.x' in the statement this.x = x; is not considered a readAccess char[] lastToken = null; Expression lhs = ((Assignment) node).lhs; if (lhs instanceof QualifiedNameReference) { char[][] tokens = ((QualifiedNameReference)lhs).tokens; lastToken = tokens[tokens.length-1]; } if (lastToken == null || matchesName(this.pattern.name, lastToken)) { nodeSet.removePossibleMatch(lhs); nodeSet.removeTrustedMatch(lhs); } } } return IMPOSSIBLE_MATCH; } public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes
public int match(Expression node, MatchingNodeSet nodeSet) { // interested in Assignment if (this.pattern.writeAccess) { if (this.pattern.readAccess) return IMPOSSIBLE_MATCH; // already checked the lhs in match(Reference...) before we reached here if (node instanceof Assignment) { Expression lhs = ((Assignment) node).lhs; if (lhs instanceof Reference) return matchReference((Reference) lhs, nodeSet, true); } } else if (this.pattern.readAccess || this.pattern.fineGrain != 0) { if (node instanceof Assignment && !(node instanceof CompoundAssignment)) { // the lhs of a simple assignment may be added in match(Reference...) before we reach here // for example, the fieldRef to 'this.x' in the statement this.x = x; is not considered a readAccess char[] lastToken = null; Expression lhs = ((Assignment) node).lhs; if (lhs instanceof QualifiedNameReference) { char[][] tokens = ((QualifiedNameReference)lhs).tokens; lastToken = tokens[tokens.length-1]; } if (lastToken == null || matchesName(this.pattern.name, lastToken)) { nodeSet.removePossibleMatch(lhs); nodeSet.removeTrustedMatch(lhs); } } } return IMPOSSIBLE_MATCH; } public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes
public int match(Expression node, MatchingNodeSet nodeSet) { // interested in Assignment if (this.pattern.writeAccess) { if (this.pattern.readAccess) return IMPOSSIBLE_MATCH; // already checked the lhs in match(Reference...) before we reached here if (node instanceof Assignment) { Expression lhs = ((Assignment) node).lhs; if (lhs instanceof Reference) return matchReference((Reference) lhs, nodeSet, true); } } else if (this.pattern.readAccess || this.pattern.fineGrain != 0) { if (node instanceof Assignment && !(node instanceof CompoundAssignment)) { // the lhs of a simple assignment may be added in match(Reference...) before we reach here // for example, the fieldRef to 'this.x' in the statement this.x = x; is not considered a readAccess char[] lastToken = null; Expression lhs = ((Assignment) node).lhs; if (lhs instanceof QualifiedNameReference) { char[][] tokens = ((QualifiedNameReference)lhs).tokens; lastToken = tokens[tokens.length-1]; } if (lastToken == null || matchesName(this.pattern.name, lastToken)) { nodeSet.removePossibleMatch(lhs); nodeSet.removeTrustedMatch(lhs); } } } return IMPOSSIBLE_MATCH; } public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes
public int match(Expression node, MatchingNodeSet nodeSet) { // interested in Assignment if (this.pattern.writeAccess) { if (this.pattern.readAccess) return IMPOSSIBLE_MATCH; // already checked the lhs in match(Reference...) before we reached here if (node instanceof Assignment) { Expression lhs = ((Assignment) node).lhs; if (lhs instanceof Reference) return matchReference((Reference) lhs, nodeSet, true); } } else if (this.pattern.readAccess || this.pattern.fineGrain != 0) { if (node instanceof Assignment && !(node instanceof CompoundAssignment)) { // the lhs of a simple assignment may be added in match(Reference...) before we reach here // for example, the fieldRef to 'this.x' in the statement this.x = x; is not considered a readAccess char[] lastToken = null; Expression lhs = ((Assignment) node).lhs; if (lhs instanceof QualifiedNameReference) { char[][] tokens = ((QualifiedNameReference)lhs).tokens; lastToken = tokens[tokens.length-1]; } if (lastToken == null || matchesName(this.pattern.name, lastToken)) { nodeSet.removePossibleMatch(lhs); nodeSet.removeTrustedMatch(lhs); } } } return IMPOSSIBLE_MATCH; } public int match(Reference node, MatchingNodeSet nodeSet) { // interested in NameReference & its subtypes