protected int matchLocalVariable(LocalVariableBinding variable, boolean matchName) { if (variable == null) return INACCURATE_MATCH; if (matchName && !matchesName(this.pattern.name, variable.readableName())) return IMPOSSIBLE_MATCH; return variable.declaration.declarationSourceStart == getLocalVariable().declarationSourceStart ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; } protected int referenceType() {
protected int matchLocalVariable(LocalVariableBinding variable, boolean matchName) { if (variable == null) return INACCURATE_MATCH; if (matchName && !matchesName(this.pattern.name, variable.readableName())) return IMPOSSIBLE_MATCH; return variable.declaration.declarationSourceStart == getLocalVariable().declarationSourceStart ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; } @Override
protected int matchLocalVariable(LocalVariableBinding variable, boolean matchName) { if (variable == null) return INACCURATE_MATCH; if (matchName && !matchesName(this.pattern.name, variable.readableName())) return IMPOSSIBLE_MATCH; return variable.declaration.declarationSourceStart == getLocalVariable().declarationSourceStart ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; } protected int referenceType() {
protected int matchLocalVariable(LocalVariableBinding variable, boolean matchName) { if (variable == null) return INACCURATE_MATCH; if (matchName && !matchesName(this.pattern.name, variable.readableName())) return IMPOSSIBLE_MATCH; return variable.declaration.declarationSourceStart == getLocalVariable().declarationSourceStart ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; } protected int referenceType() {
protected int matchLocalVariable(LocalVariableBinding variable, boolean matchName) { if (variable == null) return INACCURATE_MATCH; if (matchName && !matchesName(this.pattern.name, variable.readableName())) return IMPOSSIBLE_MATCH; return variable.declaration.declarationSourceStart == getLocalVariable().declarationSourceStart ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; } protected int referenceType() {
protected int matchLocalVariable(LocalVariableBinding variable, boolean matchName) { if (variable == null) return INACCURATE_MATCH; if (matchName && !matchesName(this.pattern.name, variable.readableName())) return IMPOSSIBLE_MATCH; return variable.declaration.declarationSourceStart == getLocalVariable().declarationSourceStart ? ACCURATE_MATCH : IMPOSSIBLE_MATCH; } protected int referenceType() {
public int match(LocalDeclaration node, MatchingNodeSet nodeSet) { int referencesLevel = IMPOSSIBLE_MATCH; if (this.pattern.findReferences) // must be a write only access with an initializer if (this.pattern.writeAccess && !this.pattern.readAccess && node.initialization != null) if (matchesName(this.pattern.name, node.name)) referencesLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; int declarationsLevel = IMPOSSIBLE_MATCH; if (this.pattern.findDeclarations) if (matchesName(this.pattern.name, node.name)) if (node.declarationSourceStart == getLocalVariable().declarationSourceStart) declarationsLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, referencesLevel >= declarationsLevel ? referencesLevel : declarationsLevel); // use the stronger match } private LocalVariable getLocalVariable() {
public int match(LocalDeclaration node, MatchingNodeSet nodeSet) { int referencesLevel = IMPOSSIBLE_MATCH; if (this.pattern.findReferences) // must be a write only access with an initializer if (this.pattern.writeAccess && !this.pattern.readAccess && node.initialization != null) if (matchesName(this.pattern.name, node.name)) referencesLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; int declarationsLevel = IMPOSSIBLE_MATCH; if (this.pattern.findDeclarations) if (matchesName(this.pattern.name, node.name)) if (node.declarationSourceStart == getLocalVariable().declarationSourceStart) declarationsLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, referencesLevel >= declarationsLevel ? referencesLevel : declarationsLevel); // use the stronger match } private LocalVariable getLocalVariable() {
public int match(LocalDeclaration node, MatchingNodeSet nodeSet) { int referencesLevel = IMPOSSIBLE_MATCH; if (this.pattern.findReferences) // must be a write only access with an initializer if (this.pattern.writeAccess && !this.pattern.readAccess && node.initialization != null) if (matchesName(this.pattern.name, node.name)) referencesLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; int declarationsLevel = IMPOSSIBLE_MATCH; if (this.pattern.findDeclarations) if (matchesName(this.pattern.name, node.name)) if (node.declarationSourceStart == getLocalVariable().declarationSourceStart) declarationsLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, referencesLevel >= declarationsLevel ? referencesLevel : declarationsLevel); // use the stronger match } private LocalVariable getLocalVariable() {
@Override public int match(LocalDeclaration node, MatchingNodeSet nodeSet) { int referencesLevel = IMPOSSIBLE_MATCH; if (this.pattern.findReferences) // must be a write only access with an initializer if (this.pattern.writeAccess && !this.pattern.readAccess && node.initialization != null) if (matchesName(this.pattern.name, node.name)) referencesLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; int declarationsLevel = IMPOSSIBLE_MATCH; if (this.pattern.findDeclarations) if (matchesName(this.pattern.name, node.name)) if (node.declarationSourceStart == getLocalVariable().declarationSourceStart) declarationsLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, referencesLevel >= declarationsLevel ? referencesLevel : declarationsLevel); // use the stronger match } private LocalVariable getLocalVariable() {
public int match(LocalDeclaration node, MatchingNodeSet nodeSet) { int referencesLevel = IMPOSSIBLE_MATCH; if (this.pattern.findReferences) // must be a write only access with an initializer if (this.pattern.writeAccess && !this.pattern.readAccess && node.initialization != null) if (matchesName(this.pattern.name, node.name)) referencesLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; int declarationsLevel = IMPOSSIBLE_MATCH; if (this.pattern.findDeclarations) if (matchesName(this.pattern.name, node.name)) if (node.declarationSourceStart == getLocalVariable().declarationSourceStart) declarationsLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, referencesLevel >= declarationsLevel ? referencesLevel : declarationsLevel); // use the stronger match } private LocalVariable getLocalVariable() {
public int match(LocalDeclaration node, MatchingNodeSet nodeSet) { int referencesLevel = IMPOSSIBLE_MATCH; if (this.pattern.findReferences) // must be a write only access with an initializer if (this.pattern.writeAccess && !this.pattern.readAccess && node.initialization != null) if (matchesName(this.pattern.name, node.name)) referencesLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; int declarationsLevel = IMPOSSIBLE_MATCH; if (this.pattern.findDeclarations) if (matchesName(this.pattern.name, node.name)) if (node.declarationSourceStart == getLocalVariable().declarationSourceStart) declarationsLevel = this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH; return nodeSet.addMatch(node, referencesLevel >= declarationsLevel ? referencesLevel : declarationsLevel); // use the stronger match } private LocalVariable getLocalVariable() {
protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { int offset = -1; int length = -1; if (reference instanceof SingleNameReference) { offset = reference.sourceStart; length = reference.sourceEnd-offset+1; } else if (reference instanceof QualifiedNameReference) { QualifiedNameReference qNameRef = (QualifiedNameReference) reference; long sourcePosition = qNameRef.sourcePositions[0]; offset = (int) (sourcePosition >>> 32); length = ((int) sourcePosition) - offset +1; } else if (reference instanceof LocalDeclaration) { LocalVariable localVariable = getLocalVariable(); offset = localVariable.nameStart; length = localVariable.nameEnd-offset+1; element = localVariable; this.match = locator.newDeclarationMatch(element, null, accuracy, offset, length); locator.report(this.match); return; } if (offset >= 0) { this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, length, reference); locator.report(this.match); } } protected int matchContainer() {
protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { int offset = -1; int length = -1; if (reference instanceof SingleNameReference) { offset = reference.sourceStart; length = reference.sourceEnd-offset+1; } else if (reference instanceof QualifiedNameReference) { QualifiedNameReference qNameRef = (QualifiedNameReference) reference; long sourcePosition = qNameRef.sourcePositions[0]; offset = (int) (sourcePosition >>> 32); length = ((int) sourcePosition) - offset +1; } else if (reference instanceof LocalDeclaration) { LocalVariable localVariable = getLocalVariable(); offset = localVariable.nameStart; length = localVariable.nameEnd-offset+1; element = localVariable; this.match = locator.newDeclarationMatch(element, null, accuracy, offset, length); locator.report(this.match); return; } if (offset >= 0) { this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, length, reference); locator.report(this.match); } } protected int matchContainer() {
@Override protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { int offset = -1; int length = -1; if (reference instanceof SingleNameReference) { offset = reference.sourceStart; length = reference.sourceEnd-offset+1; } else if (reference instanceof QualifiedNameReference) { QualifiedNameReference qNameRef = (QualifiedNameReference) reference; long sourcePosition = qNameRef.sourcePositions[0]; offset = (int) (sourcePosition >>> 32); length = ((int) sourcePosition) - offset +1; } else if (reference instanceof LocalDeclaration) { LocalVariable localVariable = getLocalVariable(); offset = localVariable.nameStart; length = localVariable.nameEnd-offset+1; element = localVariable; this.match = locator.newDeclarationMatch(element, null, accuracy, offset, length); locator.report(this.match); return; } if (offset >= 0) { this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, length, reference); locator.report(this.match); } } @Override
protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { int offset = -1; int length = -1; if (reference instanceof SingleNameReference) { offset = reference.sourceStart; length = reference.sourceEnd-offset+1; } else if (reference instanceof QualifiedNameReference) { QualifiedNameReference qNameRef = (QualifiedNameReference) reference; long sourcePosition = qNameRef.sourcePositions[0]; offset = (int) (sourcePosition >>> 32); length = ((int) sourcePosition) - offset +1; } else if (reference instanceof LocalDeclaration) { LocalVariable localVariable = getLocalVariable(); offset = localVariable.nameStart; length = localVariable.nameEnd-offset+1; element = localVariable; this.match = locator.newDeclarationMatch(element, null, accuracy, offset, length); locator.report(this.match); return; } if (offset >= 0) { this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, length, reference); locator.report(this.match); } } protected int matchContainer() {
protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { int offset = -1; int length = -1; if (reference instanceof SingleNameReference) { offset = reference.sourceStart; length = reference.sourceEnd-offset+1; } else if (reference instanceof QualifiedNameReference) { QualifiedNameReference qNameRef = (QualifiedNameReference) reference; long sourcePosition = qNameRef.sourcePositions[0]; offset = (int) (sourcePosition >>> 32); length = ((int) sourcePosition) - offset +1; } else if (reference instanceof LocalDeclaration) { LocalVariable localVariable = getLocalVariable(); offset = localVariable.nameStart; length = localVariable.nameEnd-offset+1; element = localVariable; this.match = locator.newDeclarationMatch(element, null, accuracy, offset, length); locator.report(this.match); return; } if (offset >= 0) { this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, length, reference); locator.report(this.match); } } protected int matchContainer() {
protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { int offset = -1; int length = -1; if (reference instanceof SingleNameReference) { offset = reference.sourceStart; length = reference.sourceEnd-offset+1; } else if (reference instanceof QualifiedNameReference) { QualifiedNameReference qNameRef = (QualifiedNameReference) reference; long sourcePosition = qNameRef.sourcePositions[0]; offset = (int) (sourcePosition >>> 32); length = ((int) sourcePosition) - offset +1; } else if (reference instanceof LocalDeclaration) { LocalVariable localVariable = getLocalVariable(); offset = localVariable.nameStart; length = localVariable.nameEnd-offset+1; element = localVariable; this.match = locator.newDeclarationMatch(element, null, accuracy, offset, length); locator.report(this.match); return; } if (offset >= 0) { this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, length, reference); locator.report(this.match); } } protected int matchContainer() {