@Override public SearchPattern getBlankPattern() { return new ConstructorPattern(R_EXACT_MATCH | R_CASE_SENSITIVE); } @Override
public static char[] createDefaultDeclarationIndexKey( char[] typeName, char[] packageName, int typeModifiers, int extraFlags) { return createDeclarationIndexKey( typeName, -1, // used to identify default constructor null, null, null, 0, // packageName, typeModifiers, extraFlags); }
public void addDefaultConstructorDeclaration( char[] typeName, char[] packageName, int typeModifiers, int extraFlags) { addIndexEntry(CONSTRUCTOR_DECL, ConstructorPattern.createDefaultDeclarationIndexKey(CharOperation.lastSegment(typeName,'.'), packageName, typeModifiers, extraFlags)); } public void addEnumDeclaration(int modifiers, char[] packageName, char[] name, char[][] enclosingTypeNames, char[] superclass, char[][] superinterfaces, boolean secondary) {
public EntryResult[] queryIn(Index index) throws IOException { char[] key = this.declaringSimpleName; // can be null int matchRule = getMatchRule(); switch(getMatchMode()) { case R_EXACT_MATCH : if (this.declaringSimpleName != null && this.parameterCount >= 0 && !this.varargs) { key = createIndexKey(this.declaringSimpleName, this.parameterCount); case R_PATTERN_MATCH : if (this.parameterCount >= 0 && !this.varargs) { key = CharOperation.concat(createIndexKey(this.declaringSimpleName == null ? ONE_STAR : this.declaringSimpleName, this.parameterCount), ONE_STAR); } else if (this.declaringSimpleName != null && this.declaringSimpleName[this.declaringSimpleName.length - 1] != '*') { key = CharOperation.concat(this.declaringSimpleName, ONE_STAR, SEPARATOR); return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
this.match.setRaw(parameterizedMethodBinding.isRaw); TypeBinding[] typeBindings = parameterizedMethodBinding.isRaw ? null : parameterizedMethodBinding.typeArguments; updateMatch(typeBindings, locator, this.pattern.constructorArguments, this.pattern.hasConstructorParameters()); if (!this.pattern.hasTypeArguments() && this.pattern.hasConstructorArguments() || parameterizedBinding.isParameterizedWithOwnVariables()) { } else if (this.pattern.hasTypeArguments() && !this.pattern.hasConstructorArguments()) { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); if (!this.pattern.hasTypeArguments() && this.pattern.hasConstructorArguments()) { updateMatch(parameterizedBinding, new char[][][] {this.pattern.constructorArguments}, this.pattern.hasTypeParameters(), 0, locator); } else 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); } else if (this.pattern.hasConstructorArguments()) { // binding has no type params, compatible erasure if pattern does this.match.setRule(SearchPattern.R_ERASURE_MATCH);
setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); storeTypeSignaturesAndArguments(method.getDeclaringType()); this.constructorArguments = extractMethodArguments(method); if (hasConstructorArguments()) this.mustResolve = true; setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); if (getTypeArguments() != null && getTypeArguments().length > 0) { this.constructorArguments = getTypeArguments()[0]; if (hasConstructorArguments()) this.mustResolve = true;
char[][] parameterTypeErasures = new char[argCount][]; for (int i = 0; i < parameterTypes.length; i++) { parameterTypeErasures[i] = getTypeErasure(parameterTypes[i]); int typeModifiersWithExtraFlags = typeModifiers | encodeExtraFlags(extraFlags); result[pos++] = SEPARATOR; result[pos++] = (char) typeModifiersWithExtraFlags;
public void addConstructorReference(char[] typeName, int argCount) { char[] simpleTypeName = CharOperation.lastSegment(typeName,'.'); addTypeReference(simpleTypeName); addIndexEntry(CONSTRUCTOR_REF, ConstructorPattern.createIndexKey(simpleTypeName, argCount)); char[] innermostTypeName = CharOperation.lastSegment(simpleTypeName,'$'); if (innermostTypeName != simpleTypeName) addIndexEntry(CONSTRUCTOR_REF, ConstructorPattern.createIndexKey(innermostTypeName, argCount)); } public void addDefaultConstructorDeclaration(
this.match.setRaw(parameterizedMethodBinding.isRaw); TypeBinding[] typeBindings = parameterizedMethodBinding.isRaw ? null : parameterizedMethodBinding.typeArguments; updateMatch(typeBindings, locator, this.pattern.constructorArguments, this.pattern.hasConstructorParameters()); if (!this.pattern.hasTypeArguments() && this.pattern.hasConstructorArguments() || parameterizedBinding.isParameterizedWithOwnVariables()) { } else if (this.pattern.hasTypeArguments() && !this.pattern.hasConstructorArguments()) { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); if (!this.pattern.hasTypeArguments() && this.pattern.hasConstructorArguments()) { updateMatch(parameterizedBinding, new char[][][] {this.pattern.constructorArguments}, this.pattern.hasTypeParameters(), 0, locator); } else 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); } else if (this.pattern.hasConstructorArguments()) { // binding has no type params, compatible erasure if pattern does this.match.setRule(SearchPattern.R_ERASURE_MATCH);
setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); storeTypeSignaturesAndArguments(method.getDeclaringType()); this.constructorArguments = extractMethodArguments(method); if (hasConstructorArguments()) this.mustResolve = true; setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); if (getTypeArguments() != null && getTypeArguments().length > 0) { this.constructorArguments = getTypeArguments()[0]; if (hasConstructorArguments()) this.mustResolve = true;
@Override public EntryResult[] queryIn(Index index) throws IOException { char[] key = this.declaringSimpleName; // can be null int matchRule = getMatchRule(); switch(getMatchMode()) { case R_EXACT_MATCH : if (this.declaringSimpleName != null && this.parameterCount >= 0 && !this.varargs) { key = createIndexKey(this.declaringSimpleName, this.parameterCount); case R_PATTERN_MATCH : if (this.parameterCount >= 0 && !this.varargs) { key = CharOperation.concat(createIndexKey(this.declaringSimpleName == null ? ONE_STAR : this.declaringSimpleName, this.parameterCount), ONE_STAR); } else if (this.declaringSimpleName != null && this.declaringSimpleName[this.declaringSimpleName.length - 1] != '*') { key = CharOperation.concat(this.declaringSimpleName, ONE_STAR, SEPARATOR); return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
char[][] parameterTypeErasures = new char[argCount][]; for (int i = 0; i < parameterTypes.length; i++) { parameterTypeErasures[i] = getTypeErasure(parameterTypes[i]); int typeModifiersWithExtraFlags = typeModifiers | encodeExtraFlags(extraFlags); result[pos++] = SEPARATOR; result[pos++] = (char) typeModifiersWithExtraFlags;
public void addConstructorReference(char[] typeName, int argCount) { char[] simpleTypeName = CharOperation.lastSegment(typeName,'.'); addTypeReference(simpleTypeName); addIndexEntry(CONSTRUCTOR_REF, ConstructorPattern.createIndexKey(simpleTypeName, argCount)); char[] innermostTypeName = CharOperation.lastSegment(simpleTypeName,'$'); if (innermostTypeName != simpleTypeName) addIndexEntry(CONSTRUCTOR_REF, ConstructorPattern.createIndexKey(innermostTypeName, argCount)); } public void addDefaultConstructorDeclaration(
this.match.setRaw(parameterizedMethodBinding.isRaw); TypeBinding[] typeBindings = parameterizedMethodBinding.isRaw ? null : parameterizedMethodBinding.typeArguments; updateMatch(typeBindings, locator, this.pattern.constructorArguments, this.pattern.hasConstructorParameters()); if (!this.pattern.hasTypeArguments() && this.pattern.hasConstructorArguments() || parameterizedBinding.isParameterizedWithOwnVariables()) { } else if (this.pattern.hasTypeArguments() && !this.pattern.hasConstructorArguments()) { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else { updateMatch(parameterizedBinding, this.pattern.getTypeArguments(), this.pattern.hasTypeParameters(), 0, locator); } else if (this.pattern.hasTypeArguments()) { this.match.setRule(SearchPattern.R_ERASURE_MATCH); if (!this.pattern.hasTypeArguments() && this.pattern.hasConstructorArguments()) { updateMatch(parameterizedBinding, new char[][][] {this.pattern.constructorArguments}, this.pattern.hasTypeParameters(), 0, locator); } else 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); } else if (this.pattern.hasConstructorArguments()) { // binding has no type params, compatible erasure if pattern does this.match.setRule(SearchPattern.R_ERASURE_MATCH);
setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); storeTypeSignaturesAndArguments(method.getDeclaringType()); this.constructorArguments = extractMethodArguments(method); if (hasConstructorArguments()) this.mustResolve = true; setTypeArguments(Util.getAllTypeArguments(this.typeSignatures)); if (getTypeArguments() != null && getTypeArguments().length > 0) { this.constructorArguments = getTypeArguments()[0]; if (hasConstructorArguments()) this.mustResolve = true;
public EntryResult[] queryIn(Index index) throws IOException { char[] key = this.declaringSimpleName; // can be null int matchRule = getMatchRule(); switch(getMatchMode()) { case R_EXACT_MATCH : if (this.declaringSimpleName != null && this.parameterCount >= 0 && !this.varargs) { key = createIndexKey(this.declaringSimpleName, this.parameterCount); case R_PATTERN_MATCH : if (this.parameterCount >= 0 && !this.varargs) { key = CharOperation.concat(createIndexKey(this.declaringSimpleName == null ? ONE_STAR : this.declaringSimpleName, this.parameterCount), ONE_STAR); } else if (this.declaringSimpleName != null && this.declaringSimpleName[this.declaringSimpleName.length - 1] != '*') { key = CharOperation.concat(this.declaringSimpleName, ONE_STAR, SEPARATOR); return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null
char[][] parameterTypeErasures = new char[argCount][]; for (int i = 0; i < parameterTypes.length; i++) { parameterTypeErasures[i] = getTypeErasure(parameterTypes[i]); int typeModifiersWithExtraFlags = typeModifiers | encodeExtraFlags(extraFlags); result[pos++] = SEPARATOR; result[pos++] = (char) typeModifiersWithExtraFlags;
public SearchPattern getBlankPattern() { return new ConstructorPattern(R_EXACT_MATCH | R_CASE_SENSITIVE); } public char[][] getIndexCategories() {
public static char[] createDefaultDeclarationIndexKey( char[] typeName, char[] packageName, int typeModifiers, int extraFlags) { return createDeclarationIndexKey( typeName, -1, // used to identify default constructor null, null, null, 0, // packageName, typeModifiers, extraFlags); }
public void addConstructorReference(char[] typeName, int argCount) { char[] simpleTypeName = CharOperation.lastSegment(typeName,'.'); addTypeReference(simpleTypeName); addIndexEntry(CONSTRUCTOR_REF, ConstructorPattern.createIndexKey(simpleTypeName, argCount)); char[] innermostTypeName = CharOperation.lastSegment(simpleTypeName,'$'); if (innermostTypeName != simpleTypeName) addIndexEntry(CONSTRUCTOR_REF, ConstructorPattern.createIndexKey(innermostTypeName, argCount)); } public void addDefaultConstructorDeclaration(