01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.compiler.lookup;
11:
12: public class ProblemMethodBinding extends MethodBinding {
13:
14: private int problemReason;
15: public MethodBinding closestMatch; // TODO (philippe) should rename into #alternateMatch
16:
17: public ProblemMethodBinding(char[] selector, TypeBinding[] args,
18: int problemReason) {
19: this .selector = selector;
20: this .parameters = (args == null || args.length == 0) ? Binding.NO_PARAMETERS
21: : args;
22: this .problemReason = problemReason;
23: this .thrownExceptions = Binding.NO_EXCEPTIONS;
24: }
25:
26: public ProblemMethodBinding(char[] selector, TypeBinding[] args,
27: ReferenceBinding declaringClass, int problemReason) {
28: this .selector = selector;
29: this .parameters = (args == null || args.length == 0) ? Binding.NO_PARAMETERS
30: : args;
31: this .declaringClass = declaringClass;
32: this .problemReason = problemReason;
33: this .thrownExceptions = Binding.NO_EXCEPTIONS;
34: }
35:
36: public ProblemMethodBinding(MethodBinding closestMatch,
37: char[] selector, TypeBinding[] args, int problemReason) {
38: this (selector, args, problemReason);
39: this .closestMatch = closestMatch;
40: if (closestMatch != null
41: && problemReason != ProblemReasons.Ambiguous)
42: this .declaringClass = closestMatch.declaringClass;
43: }
44:
45: /* API
46: * Answer the problem id associated with the receiver.
47: * NoError if the receiver is a valid binding.
48: */
49:
50: public final int problemId() {
51: return this.problemReason;
52: }
53: }
|