/** * Reports the match of the given reference. Also provide a local element to eventually report in match. */ protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { matchReportReference(reference, element, elementBinding, accuracy, locator); } public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, int length, MatchLocator locator) {
/** * Reports the match of the given reference. Also provide a local element to eventually report in match. */ protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { matchReportReference(reference, element, elementBinding, accuracy, locator); } public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, int length, MatchLocator locator) {
@Override protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { super.matchReportReference(reference, element, elementBinding, accuracy, locator); } @Override
/** * Reports the match of the given reference. Also provide a local element to eventually report in match. */ protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { matchReportReference(reference, element, elementBinding, accuracy, locator); } public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, int length, MatchLocator locator) {
@Override protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { super.matchReportReference(reference, element, elementBinding, accuracy, locator); } @Override
/** * Reports the match of the given reference. Also provide a local element to eventually report in match. */ protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { matchReportReference(reference, element, elementBinding, accuracy, locator); } public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, int length, MatchLocator locator) {
/** * Reports the match of the given reference. Also provide a local element to eventually report in match. */ protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { matchReportReference(reference, element, elementBinding, accuracy, locator); } public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, int length, MatchLocator locator) {
/** * Reports the match of the given reference. Also provide a local element to eventually report in match. */ protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { matchReportReference(reference, element, elementBinding, accuracy, locator); } public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, int length, MatchLocator locator) {
/** * Reports the match of the given import reference. */ protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (locator.encloses(element)) { // default is to report a match as a regular ref. this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } } /**
/** * Reports the match of the given import reference. */ protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (locator.encloses(element)) { // default is to report a match as a regular ref. this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } } /**
/** * Reports the match of the given import reference. */ protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (locator.encloses(element)) { // default is to report a match as a regular ref. this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } } /**
/** * Reports the match of the given import reference. */ protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (locator.encloses(element)) { // default is to report a match as a regular ref. this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } } /**
/** * Reports the match of the given import reference. */ protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (locator.encloses(element)) { // default is to report a match as a regular ref. this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } } /**
/** * Reports the match of the given import reference. */ protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (locator.encloses(element)) { // default is to report a match as a regular ref. this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } } /**
private void reportMatching(RequiresStatement[] reqs, ModuleDeclaration module, MatchingNodeSet nodeSet, IModuleDescription moduleDesc) { if (reqs == null || reqs.length == 0) return; try { for (RequiresStatement req : reqs) { Integer level = (Integer) nodeSet.matchingNodes.removeKey(req.module); if (level != null) { this.patternLocator.matchReportReference(req.module, moduleDesc, req.resolvedBinding, level.intValue(), this); } } } catch (CoreException e) { // do nothing } }
protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { PatternLocator weakestPattern = null; int level = IMPOSSIBLE_MATCH; for (int i = 0, length = this.patternLocators.length; i < length; i++) { if (this.patternLocators[i].referenceType() == 0) return; // impossible match int newLevel = this.patternLocators[i].resolveLevel(reference); if (newLevel == IMPOSSIBLE_MATCH) return; if (weakestPattern == null || newLevel < level) { weakestPattern = this.patternLocators[i]; level = newLevel; } } weakestPattern.matchReportReference(reference, element, localElement, otherElements, elementBinding, accuracy, locator); } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { PatternLocator weakestPattern = null; int level = IMPOSSIBLE_MATCH; for (int i = 0, length = this.patternLocators.length; i < length; i++) { if (this.patternLocators[i].referenceType() == 0) return; // impossible match int newLevel = this.patternLocators[i].resolveLevel(reference); if (newLevel == IMPOSSIBLE_MATCH) return; if (weakestPattern == null || newLevel < level) { weakestPattern = this.patternLocators[i]; level = newLevel; } } weakestPattern.matchReportReference(reference, element, localElement, otherElements, elementBinding, accuracy, locator); } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { PatternLocator weakestPattern = null; int level = IMPOSSIBLE_MATCH; for (int i = 0, length = this.patternLocators.length; i < length; i++) { if (this.patternLocators[i].referenceType() == 0) return; // impossible match int newLevel = this.patternLocators[i].resolveLevel(reference); if (newLevel == IMPOSSIBLE_MATCH) return; if (weakestPattern == null || newLevel < level) { weakestPattern = this.patternLocators[i]; level = newLevel; } } weakestPattern.matchReportReference(reference, element, localElement, otherElements, elementBinding, accuracy, locator); } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { if (elementBinding instanceof ReferenceBinding) { ReferenceBinding referenceBinding = (ReferenceBinding) elementBinding; if (referenceBinding.isClass() && this.pattern.typeSuffix == IIndexConstants.INTERFACE_SUFFIX) { // do not report class if expected types are only interfaces return; } if (referenceBinding.isInterface() && this.pattern.typeSuffix == IIndexConstants.CLASS_SUFFIX) { // do not report interface if expected types are only classes return; } } super.matchReportReference(reference, element, elementBinding, accuracy, locator); } protected int referenceType() {
protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { if (elementBinding instanceof ReferenceBinding) { ReferenceBinding referenceBinding = (ReferenceBinding) elementBinding; if (referenceBinding.isClass() && this.pattern.typeSuffix == IIndexConstants.INTERFACE_SUFFIX) { // do not report class if expected types are only interfaces return; } if (referenceBinding.isInterface() && this.pattern.typeSuffix == IIndexConstants.CLASS_SUFFIX) { // do not report interface if expected types are only classes return; } } super.matchReportReference(reference, element, elementBinding, accuracy, locator); } protected int referenceType() {