public EntryResult[] queryIn(Index index) throws IOException { char[] key = this.selector; // can be null int matchRule = getMatchRule(); switch(getMatchMode()) { case R_EXACT_MATCH : if (this.selector != null && this.parameterCount >= 0 && !this.varargs) key = createIndexKey(this.selector, this.parameterCount); else { // do a prefix query with the selector matchRule &= ~R_EXACT_MATCH; case R_PATTERN_MATCH : if (this.parameterCount >= 0 && !this.varargs) key = createIndexKey(this.selector == null ? ONE_STAR : this.selector, this.parameterCount); else if (this.selector != null && this.selector[this.selector.length - 1] != '*') key = CharOperation.concat(this.selector, ONE_STAR, SEPARATOR); return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
@Override public SearchPattern getBlankPattern() { return new MethodPattern(R_EXACT_MATCH | R_CASE_SENSITIVE); } @Override
this.match.setRaw(parameterizedMethodBinding.isRaw); updateMatch(typeArguments, locator, this.pattern.methodArguments, this.pattern.hasMethodParameters()); if (!this.pattern.hasTypeArguments() && this.pattern.hasMethodArguments() || parameterizedBinding.isParameterizedWithOwnVariables()) { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); ParameterizedTypeBinding parameterizedBinding = (ParameterizedTypeBinding)methodBinding.declaringClass; if (!parameterizedBinding.isParameterizedWithOwnVariables()) { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); this.match.setRule(SearchPattern.R_ERASURE_MATCH); } else if (this.pattern.hasMethodArguments()) { // binding has no type params, compatible erasure if pattern does this.match.setRule(SearchPattern.R_ERASURE_MATCH); this.match.setOffset(offset); this.match.setLength(messageSend.sourceEnd - offset + 1); if (isParameterized && this.pattern.hasMethodArguments()) { locator.reportAccurateParameterizedMethodReference(this.match, messageSend, messageSend.typeArguments); } else {
setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); storeTypeSignaturesAndArguments(this.declaringType); this.methodArguments = extractMethodArguments(method); if (hasMethodArguments()) this.mustResolve = true; setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); if (hasMethodArguments()) this.mustResolve = true;
public void addMethodReference(char[] methodName, int argCount) { addIndexEntry(METHOD_REF, MethodPattern.createIndexKey(methodName, argCount)); } public void addModuleDeclaration(char[] moduleName) {
if (this.pattern.hasMethodArguments()) { if (node.typeParameters == null || node.typeParameters.length != this.pattern.methodArguments.length) return IMPOSSIBLE_MATCH;
public MethodFilter(String methodPattern) { if (methodPattern.startsWith("(")) { methodPattern = "*" + methodPattern; } this.pattern = (MethodPattern) SearchPattern.createPattern(methodPattern, IJavaSearchConstants.METHOD, 0, SearchPattern.R_PATTERN_MATCH | SearchPattern.R_CASE_SENSITIVE); if (pattern != null) { int matchRule = pattern.getMatchRule(); this.matchMode = matchRule & JavaSearchPattern.MATCH_MODE_MASK; requireResolveBinding = requireResolveBinding(pattern); } isCaseSensitive = true; }
this.match.setRaw(parameterizedMethodBinding.isRaw); updateMatch(typeArguments, locator, this.pattern.methodArguments, this.pattern.hasMethodParameters()); if (!this.pattern.hasTypeArguments() && this.pattern.hasMethodArguments() || parameterizedBinding.isParameterizedWithOwnVariables()) { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); this.match.setRule(SearchPattern.R_ERASURE_MATCH); } else if (this.pattern.hasMethodArguments()) { // binding has no type params, compatible erasure if pattern does this.match.setRule(SearchPattern.R_ERASURE_MATCH); this.match.setOffset(offset); this.match.setLength(messageSend.sourceEnd - offset + 1); if (isParameterized && this.pattern.hasMethodArguments()) { locator.reportAccurateParameterizedMethodReference(this.match, messageSend, messageSend.typeArguments); } else {
setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); storeTypeSignaturesAndArguments(this.declaringType); this.methodArguments = extractMethodArguments(method); if (hasMethodArguments()) this.mustResolve = true; setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); if (hasMethodArguments()) this.mustResolve = true;
public void addMethodReference(char[] methodName, int argCount) { addIndexEntry(METHOD_REF, MethodPattern.createIndexKey(methodName, argCount)); } public void addModuleDeclaration(char[] moduleName) {
if (this.pattern.hasMethodArguments()) { if (node.typeParameters == null || node.typeParameters.length != this.pattern.methodArguments.length) return IMPOSSIBLE_MATCH;
this.match.setRaw(parameterizedMethodBinding.isRaw); updateMatch(typeArguments, locator, this.pattern.methodArguments, this.pattern.hasMethodParameters()); if (!this.pattern.hasTypeArguments() && this.pattern.hasMethodArguments() || parameterizedBinding.isParameterizedWithOwnVariables()) { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); this.match.setRule(SearchPattern.R_ERASURE_MATCH); } else if (this.pattern.hasMethodArguments()) { // binding has no type params, compatible erasure if pattern does this.match.setRule(SearchPattern.R_ERASURE_MATCH); this.match.setOffset(offset); this.match.setLength(messageSend.sourceEnd - offset + 1); if (isParameterized && this.pattern.hasMethodArguments()) { locator.reportAccurateParameterizedMethodReference(this.match, messageSend, messageSend.typeArguments); } else {
@Override public EntryResult[] queryIn(Index index) throws IOException { char[] key = this.selector; // can be null int matchRule = getMatchRule(); switch(getMatchMode()) { case R_EXACT_MATCH : if (this.selector != null && this.parameterCount >= 0 && !this.varargs) key = createIndexKey(this.selector, this.parameterCount); else { // do a prefix query with the selector matchRule &= ~R_EXACT_MATCH; case R_PATTERN_MATCH : if (this.parameterCount >= 0 && !this.varargs) key = createIndexKey(this.selector == null ? ONE_STAR : this.selector, this.parameterCount); else if (this.selector != null && this.selector[this.selector.length - 1] != '*') key = CharOperation.concat(this.selector, ONE_STAR, SEPARATOR); return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); storeTypeSignaturesAndArguments(this.declaringType); this.methodArguments = extractMethodArguments(method); if (hasMethodArguments()) this.mustResolve = true; setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); if (hasMethodArguments()) this.mustResolve = true;
public SearchPattern getBlankPattern() { return new MethodPattern(R_EXACT_MATCH | R_CASE_SENSITIVE); } public char[][] getIndexCategories() {
public void addMethodReference(char[] methodName, int argCount) { addIndexEntry(METHOD_REF, MethodPattern.createIndexKey(methodName, argCount)); } public void addNameReference(char[] name) {
if (this.pattern.hasMethodArguments()) { if (node.typeParameters == null || node.typeParameters.length != this.pattern.methodArguments.length) return IMPOSSIBLE_MATCH;
this.match.setRaw(parameterizedMethodBinding.isRaw); updateMatch(typeArguments, locator, this.pattern.methodArguments, this.pattern.hasMethodParameters()); if (!this.pattern.hasTypeArguments() && this.pattern.hasMethodArguments() || parameterizedBinding.isParameterizedWithOwnVariables()) { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); this.match.setRule(SearchPattern.R_ERASURE_MATCH); } else if (this.pattern.hasMethodArguments()) { // binding has no type params, compatible erasure if pattern does this.match.setRule(SearchPattern.R_ERASURE_MATCH); this.match.setOffset(offset); this.match.setLength(messageSend.sourceEnd - offset + 1); if (isParameterized && this.pattern.hasMethodArguments()) { locator.reportAccurateParameterizedMethodReference(this.match, messageSend, messageSend.typeArguments); } else {
public EntryResult[] queryIn(Index index) throws IOException { char[] key = this.selector; // can be null int matchRule = getMatchRule(); switch(getMatchMode()) { case R_EXACT_MATCH : if (this.selector != null && this.parameterCount >= 0 && !this.varargs) key = createIndexKey(this.selector, this.parameterCount); else { // do a prefix query with the selector matchRule &= ~R_EXACT_MATCH; case R_PATTERN_MATCH : if (this.parameterCount >= 0 && !this.varargs) key = createIndexKey(this.selector == null ? ONE_STAR : this.selector, this.parameterCount); else if (this.selector != null && this.selector[this.selector.length - 1] != '*') key = CharOperation.concat(this.selector, ONE_STAR, SEPARATOR); return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); storeTypeSignaturesAndArguments(this.declaringType); this.methodArguments = extractMethodArguments(method); if (hasMethodArguments()) this.mustResolve = true; setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); if (hasMethodArguments()) this.mustResolve = true;