@Override public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } @Override
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } public int resolveLevel(ASTNode node) {
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } public int resolveLevel(ASTNode node) {
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } public int resolveLevel(ASTNode node) {
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } public int resolveLevel(ASTNode node) {
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } public int resolveLevel(ASTNode node) {