private void reportPackageMatch(MatchLocator locator, PackageBinding packageBinding) throws CoreException{ if (packageBinding == null) return; int level = locator.patternLocator.resolveLevel(packageBinding); if (level == PatternLocator.IMPOSSIBLE_MATCH) return; int accuracy = level == PatternLocator.ACCURATE_MATCH ? SearchMatch.A_ACCURATE : SearchMatch.A_INACCURATE; PackageReferenceMatch match = locator.newPackageReferenceMatch(this.moduleDesc, accuracy, -1, 0, null); locator.report(match); } private void matchPackReferences(MatchLocator locator, PackageReferencePattern packReferencePattern,
private void reportPackageMatch(MatchLocator locator, PackageBinding packageBinding) throws CoreException{ if (packageBinding == null) return; int level = locator.patternLocator.resolveLevel(packageBinding); if (level == PatternLocator.IMPOSSIBLE_MATCH) return; int accuracy = level == PatternLocator.ACCURATE_MATCH ? SearchMatch.A_ACCURATE : SearchMatch.A_INACCURATE; PackageReferenceMatch match = locator.newPackageReferenceMatch(this.moduleDesc, accuracy, -1, 0, null); locator.report(match); } private void matchPackReferences(MatchLocator locator, PackageReferencePattern packReferencePattern,
protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (binding == null) { this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } else { if (locator.encloses(element)) { long[] positions = importRef.sourcePositions; int last = positions.length - 1; if (binding instanceof ProblemReferenceBinding) binding = ((ProblemReferenceBinding) binding).closestMatch(); if (binding instanceof ReferenceBinding) { PackageBinding pkgBinding = ((ReferenceBinding) binding).fPackage; if (pkgBinding != null) last = pkgBinding.compoundName.length; } if (binding instanceof PackageBinding) last = ((PackageBinding) binding).compoundName.length; int start = (int) (positions[0] >>> 32); int end = (int) positions[last - 1]; this.match = locator.newPackageReferenceMatch(element, accuracy, start, end-start+1, importRef); locator.report(this.match); } } } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (binding == null) { this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } else { if (locator.encloses(element)) { long[] positions = importRef.sourcePositions; int last = positions.length - 1; if (binding instanceof ProblemReferenceBinding) binding = ((ProblemReferenceBinding) binding).closestMatch(); if (binding instanceof ReferenceBinding) { PackageBinding pkgBinding = ((ReferenceBinding) binding).fPackage; if (pkgBinding != null) last = pkgBinding.compoundName.length; } if (binding instanceof PackageBinding) last = ((PackageBinding) binding).compoundName.length; int start = (int) (positions[0] >>> 32); int end = (int) positions[last - 1]; this.match = locator.newPackageReferenceMatch(element, accuracy, start, end-start+1, importRef); locator.report(this.match); } } } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (binding == null) { this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } else { if (locator.encloses(element)) { long[] positions = importRef.sourcePositions; int last = positions.length - 1; if (binding instanceof ProblemReferenceBinding) binding = ((ProblemReferenceBinding) binding).closestMatch(); if (binding instanceof ReferenceBinding) { PackageBinding pkgBinding = ((ReferenceBinding) binding).fPackage; if (pkgBinding != null) last = pkgBinding.compoundName.length; } if (binding instanceof PackageBinding) last = ((PackageBinding) binding).compoundName.length; int start = (int) (positions[0] >>> 32); int end = (int) positions[last > 0 ? last - 1 : 0]; this.match = locator.newPackageReferenceMatch(element, accuracy, start, end-start+1, importRef); locator.report(this.match); } } } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
@Override protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (binding == null) { this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } else { if (locator.encloses(element)) { long[] positions = importRef.sourcePositions; int last = positions.length - 1; if (binding instanceof ProblemReferenceBinding) binding = ((ProblemReferenceBinding) binding).closestMatch(); if (binding instanceof ReferenceBinding) { PackageBinding pkgBinding = ((ReferenceBinding) binding).fPackage; if (pkgBinding != null) last = pkgBinding.compoundName.length; } if (binding instanceof PackageBinding) last = ((PackageBinding) binding).compoundName.length; int start = (int) (positions[0] >>> 32); int end = (int) positions[last > 0 ? last - 1 : 0]; this.match = locator.newPackageReferenceMatch(element, accuracy, start, end-start+1, importRef); locator.report(this.match); } } } @Override
protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (binding == null) { this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } else { if (locator.encloses(element)) { long[] positions = importRef.sourcePositions; int last = positions.length - 1; if (binding instanceof ProblemReferenceBinding) binding = ((ProblemReferenceBinding) binding).closestMatch(); if (binding instanceof ReferenceBinding) { PackageBinding pkgBinding = ((ReferenceBinding) binding).fPackage; if (pkgBinding != null) last = pkgBinding.compoundName.length; } if (binding instanceof PackageBinding) last = ((PackageBinding) binding).compoundName.length; int start = (int) (positions[0] >>> 32); int end = (int) positions[last - 1]; this.match = locator.newPackageReferenceMatch(element, accuracy, start, end-start+1, importRef); locator.report(this.match); } } } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
protected void matchReportImportRef(ImportReference importRef, Binding binding, IJavaElement element, int accuracy, MatchLocator locator) throws CoreException { if (binding == null) { this.matchReportReference(importRef, element, null/*no binding*/, accuracy, locator); } else { if (locator.encloses(element)) { long[] positions = importRef.sourcePositions; int last = positions.length - 1; if (binding instanceof ProblemReferenceBinding) binding = ((ProblemReferenceBinding) binding).closestMatch(); if (binding instanceof ReferenceBinding) { PackageBinding pkgBinding = ((ReferenceBinding) binding).fPackage; if (pkgBinding != null) last = pkgBinding.compoundName.length; } if (binding instanceof PackageBinding) last = ((PackageBinding) binding).compoundName.length; int start = (int) (positions[0] >>> 32); int end = (int) positions[last - 1]; this.match = locator.newPackageReferenceMatch(element, accuracy, start, end-start+1, importRef); locator.report(this.match); } } } protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {
/** * Reports the match of the given reference. */ protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { this.match = null; int referenceType = referenceType(); int offset = reference.sourceStart; switch (referenceType) { case IJavaElement.PACKAGE_FRAGMENT: this.match = locator.newPackageReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE: this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.FIELD: this.match = locator.newFieldReferenceMatch(element, null, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.LOCAL_VARIABLE: this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE_PARAMETER: this.match = locator.newTypeParameterReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; } if (this.match != null) { locator.report(this.match); } } /**
/** * Reports the match of the given reference. */ protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { this.match = null; int referenceType = referenceType(); int offset = reference.sourceStart; switch (referenceType) { case IJavaElement.PACKAGE_FRAGMENT: this.match = locator.newPackageReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE: this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.FIELD: this.match = locator.newFieldReferenceMatch(element, null, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.LOCAL_VARIABLE: this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE_PARAMETER: this.match = locator.newTypeParameterReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; } if (this.match != null) { locator.report(this.match); } } /**
/** * Reports the match of the given reference. */ protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { this.match = null; int referenceType = referenceType(); int offset = reference.sourceStart; switch (referenceType) { case IJavaElement.PACKAGE_FRAGMENT: this.match = locator.newPackageReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE: this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.FIELD: this.match = locator.newFieldReferenceMatch(element, null, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.LOCAL_VARIABLE: this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE_PARAMETER: this.match = locator.newTypeParameterReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; } if (this.match != null) { locator.report(this.match); } } /**
/** * Reports the match of the given reference. */ protected void matchReportReference(ASTNode reference, IJavaElement element, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException { this.match = null; int referenceType = referenceType(); int offset = reference.sourceStart; switch (referenceType) { case IJavaElement.PACKAGE_FRAGMENT: this.match = locator.newPackageReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE: this.match = locator.newTypeReferenceMatch(element, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.FIELD: this.match = locator.newFieldReferenceMatch(element, null, elementBinding, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.LOCAL_VARIABLE: this.match = locator.newLocalVariableReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE_PARAMETER: this.match = locator.newTypeParameterReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; } if (this.match != null) { locator.report(this.match); } } /**
switch (referenceType) { case IJavaElement.PACKAGE_FRAGMENT: this.match = locator.newPackageReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE:
switch (referenceType) { case IJavaElement.PACKAGE_FRAGMENT: this.match = locator.newPackageReferenceMatch(element, accuracy, offset, reference.sourceEnd-offset+1, reference); break; case IJavaElement.TYPE:
int sourceStart = (int) (positions[0] >>> 32); int sourceEnd = ((int) positions[last - 1]); PackageReferenceMatch packageReferenceMatch = locator.newPackageReferenceMatch(element, accuracy, sourceStart, sourceEnd-sourceStart+1, reference); packageReferenceMatch.setLocalElement(localElement); this.match = packageReferenceMatch;
int sourceStart = (int) (positions[0] >>> 32); int sourceEnd = ((int) positions[last - 1]); PackageReferenceMatch packageReferenceMatch = locator.newPackageReferenceMatch(element, accuracy, sourceStart, sourceEnd-sourceStart+1, reference); packageReferenceMatch.setLocalElement(localElement); this.match = packageReferenceMatch;
int sourceStart = (int) (positions[0] >>> 32); int sourceEnd = ((int) positions[last - 1]); PackageReferenceMatch packageReferenceMatch = locator.newPackageReferenceMatch(element, accuracy, sourceStart, sourceEnd-sourceStart+1, reference); packageReferenceMatch.setLocalElement(localElement); this.match = packageReferenceMatch;
int sourceStart = (int) (positions[0] >>> 32); int sourceEnd = ((int) positions[last - 1]); PackageReferenceMatch packageReferenceMatch = locator.newPackageReferenceMatch(element, accuracy, sourceStart, sourceEnd-sourceStart+1, reference); packageReferenceMatch.setLocalElement(localElement); this.match = packageReferenceMatch;
int sourceStart = (int) (positions[0] >>> 32); int sourceEnd = ((int) positions[last - 1]); PackageReferenceMatch packageReferenceMatch = locator.newPackageReferenceMatch(element, accuracy, sourceStart, sourceEnd-sourceStart+1, reference); packageReferenceMatch.setLocalElement(localElement); this.match = packageReferenceMatch;
int sourceStart = (int) (positions[0] >>> 32); int sourceEnd = ((int) positions[last - 1]); PackageReferenceMatch packageReferenceMatch = locator.newPackageReferenceMatch(element, accuracy, sourceStart, sourceEnd-sourceStart+1, reference); packageReferenceMatch.setLocalElement(localElement); this.match = packageReferenceMatch;