protected int matchConstructor(MethodBinding constructor) { if (!constructor.isConstructor()) return IMPOSSIBLE_MATCH; // declaring type, simple name has already been matched by matchIndexEntry() int level = resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, constructor.declaringClass); if (level == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH; // parameter types int parameterCount = this.pattern.parameterCount; if (parameterCount > -1) { if (constructor.parameters == null) return INACCURATE_MATCH; if (parameterCount != constructor.parameters.length) return IMPOSSIBLE_MATCH; for (int i = 0; i < parameterCount; i++) { // TODO (frederic) use this call to refine accuracy on parameter types // int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], this.pattern.parametersTypeArguments[i], 0, constructor.parameters[i]); int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], constructor.parameters[i]); if (level > newLevel) { if (newLevel == IMPOSSIBLE_MATCH) { // if (isErasureMatch) { // return ERASURE_MATCH; // } return IMPOSSIBLE_MATCH; } level = newLevel; // can only be downgraded } } } return level; } @Override
protected int matchConstructor(MethodBinding constructor) { if (!constructor.isConstructor()) return IMPOSSIBLE_MATCH; // declaring type, simple name has already been matched by matchIndexEntry() int level = resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, constructor.declaringClass); if (level == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH; // parameter types int parameterCount = this.pattern.parameterCount; if (parameterCount > -1) { if (constructor.parameters == null) return INACCURATE_MATCH; if (parameterCount != constructor.parameters.length) return IMPOSSIBLE_MATCH; for (int i = 0; i < parameterCount; i++) { // TODO (frederic) use this call to refine accuracy on parameter types // int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], this.pattern.parametersTypeArguments[i], 0, constructor.parameters[i]); int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], constructor.parameters[i]); if (level > newLevel) { if (newLevel == IMPOSSIBLE_MATCH) { // if (isErasureMatch) { // return ERASURE_MATCH; // } return IMPOSSIBLE_MATCH; } level = newLevel; // can only be downgraded } } } return level; } protected int matchContainer() {
protected int matchConstructor(MethodBinding constructor) { if (!constructor.isConstructor()) return IMPOSSIBLE_MATCH; // declaring type, simple name has already been matched by matchIndexEntry() int level = resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, constructor.declaringClass); if (level == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH; // parameter types int parameterCount = this.pattern.parameterCount; if (parameterCount > -1) { if (constructor.parameters == null) return INACCURATE_MATCH; if (parameterCount != constructor.parameters.length) return IMPOSSIBLE_MATCH; for (int i = 0; i < parameterCount; i++) { // TODO (frederic) use this call to refine accuracy on parameter types // int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], this.pattern.parametersTypeArguments[i], 0, constructor.parameters[i]); int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], constructor.parameters[i]); if (level > newLevel) { if (newLevel == IMPOSSIBLE_MATCH) { // if (isErasureMatch) { // return ERASURE_MATCH; // } return IMPOSSIBLE_MATCH; } level = newLevel; // can only be downgraded } } } return level; } protected int matchContainer() {
protected int matchConstructor(MethodBinding constructor) { if (!constructor.isConstructor()) return IMPOSSIBLE_MATCH; // declaring type, simple name has already been matched by matchIndexEntry() int level = resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, constructor.declaringClass); if (level == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH; // parameter types int parameterCount = this.pattern.parameterCount; if (parameterCount > -1) { if (constructor.parameters == null) return INACCURATE_MATCH; if (parameterCount != constructor.parameters.length) return IMPOSSIBLE_MATCH; for (int i = 0; i < parameterCount; i++) { // TODO (frederic) use this call to refine accuracy on parameter types // int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], this.pattern.parametersTypeArguments[i], 0, constructor.parameters[i]); int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], constructor.parameters[i]); if (level > newLevel) { if (newLevel == IMPOSSIBLE_MATCH) { // if (isErasureMatch) { // return ERASURE_MATCH; // } return IMPOSSIBLE_MATCH; } level = newLevel; // can only be downgraded } } } return level; } protected int matchContainer() {
protected int matchConstructor(MethodBinding constructor) { if (!constructor.isConstructor()) return IMPOSSIBLE_MATCH; // declaring type, simple name has already been matched by matchIndexEntry() int level = resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, constructor.declaringClass); if (level == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH; // parameter types int parameterCount = this.pattern.parameterCount; if (parameterCount > -1) { if (constructor.parameters == null) return INACCURATE_MATCH; if (parameterCount != constructor.parameters.length) return IMPOSSIBLE_MATCH; for (int i = 0; i < parameterCount; i++) { // TODO (frederic) use this call to refine accuracy on parameter types // int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], this.pattern.parametersTypeArguments[i], 0, constructor.parameters[i]); int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], constructor.parameters[i]); if (level > newLevel) { if (newLevel == IMPOSSIBLE_MATCH) { // if (isErasureMatch) { // return ERASURE_MATCH; // } return IMPOSSIBLE_MATCH; } level = newLevel; // can only be downgraded } } } return level; } protected int matchContainer() {
protected int matchConstructor(MethodBinding constructor) { if (!constructor.isConstructor()) return IMPOSSIBLE_MATCH; // declaring type, simple name has already been matched by matchIndexEntry() int level = resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, constructor.declaringClass); if (level == IMPOSSIBLE_MATCH) return IMPOSSIBLE_MATCH; // parameter types int parameterCount = this.pattern.parameterCount; if (parameterCount > -1) { if (constructor.parameters == null) return INACCURATE_MATCH; if (parameterCount != constructor.parameters.length) return IMPOSSIBLE_MATCH; for (int i = 0; i < parameterCount; i++) { // TODO (frederic) use this call to refine accuracy on parameter types // int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], this.pattern.parametersTypeArguments[i], 0, constructor.parameters[i]); int newLevel = resolveLevelForType(this.pattern.parameterSimpleNames[i], this.pattern.parameterQualifications[i], constructor.parameters[i]); if (level > newLevel) { if (newLevel == IMPOSSIBLE_MATCH) { // if (isErasureMatch) { // return ERASURE_MATCH; // } return IMPOSSIBLE_MATCH; } level = newLevel; // can only be downgraded } } } return level; } protected int matchContainer() {