TypeBinding[] typeBindings = parameterizedMethodBinding.isRaw ? null : parameterizedMethodBinding.typeArguments;
updateMatch(typeBindings, locator, this.pattern.constructorArguments, this.pattern.hasConstructorParameters());
// Update match regarding declaring class type arguments
if (constructorBinding.declaringClass.isParameterizedType() || constructorBinding.declaringClass.isRawType()) {
ParameterizedTypeBinding parameterizedBinding = (ParameterizedTypeBinding)constructorBinding.declaringClass;
if (!this.pattern.hasTypeArguments() && this.pattern.hasConstructorArguments() || parameterizedBinding.isParameterizedWithOwnVariables()) {
// special case for constructor pattern which defines arguments but no type
// in this case, we only use refined accuracy for constructor
} else if (this.pattern.hasTypeArguments() && !this.pattern.hasConstructorArguments()) {
// special case for constructor pattern which defines no constructor arguments but has type ones
// in this case, we do not use refined accuracy
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);
}
// Update match regarding constructor parameters
// TODO ? (frederic)
} else if (constructorBinding instanceof ParameterizedMethodBinding) {
// Update match regarding declaring class type arguments
if (constructorBinding.declaringClass.isParameterizedType() || constructorBinding.declaringClass.isRawType()) {
ParameterizedTypeBinding parameterizedBinding = (ParameterizedTypeBinding)constructorBinding.declaringClass;
if (!this.pattern.hasTypeArguments() && this.pattern.hasConstructorArguments()) {
// special case for constructor pattern which defines arguments but no type
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);
}