1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.lookup;
13 public class ProblemMethodBinding extends MethodBinding {
15 private int problemReason;
16 public MethodBinding closestMatch; // TODO (philippe) should rename into #alternateMatch
18 public ProblemMethodBinding(char[] selector, TypeBinding[] args, int problemReason) {
19 this.selector = selector;
20 this.parameters = (args == null || args.length == 0) ? NoParameters : args;
21 this.problemReason = problemReason;
23 public ProblemMethodBinding(char[] selector, TypeBinding[] args, ReferenceBinding declaringClass, int problemReason) {
24 this.selector = selector;
25 this.parameters = (args == null || args.length == 0) ? NoParameters : args;
26 this.declaringClass = declaringClass;
27 this.problemReason = problemReason;
29 public ProblemMethodBinding(MethodBinding closestMatch, char[] selector, TypeBinding[] args, int problemReason) {
30 this(selector, args, problemReason);
31 this.closestMatch = closestMatch;
32 if (closestMatch != null) this.declaringClass = closestMatch.declaringClass;
35 * Answer the problem id associated with the receiver.
36 * NoError if the receiver is a valid binding.
39 public final int problemId() {
40 return this.problemReason;