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 ProblemReferenceBinding extends ReferenceBinding {
14 public ReferenceBinding original;
15 private int problemReason;
16 public ReferenceBinding alternateMatch;
18 // NOTE: must only answer the subset of the name related to the problem
20 public ProblemReferenceBinding(char[][] compoundName, int problemReason) {
21 this(compoundName, null, problemReason);
23 public ProblemReferenceBinding(char[] name, int problemReason) {
24 this(new char[][] {name}, null, problemReason);
27 public ProblemReferenceBinding(char[][] compoundName, ReferenceBinding original, int problemReason) {
28 this.compoundName = compoundName;
29 this.original = original;
30 this.problemReason = problemReason;
32 public ProblemReferenceBinding(char[] name, ReferenceBinding original, int problemReason) {
33 this(new char[][] {name}, original, problemReason);
36 * Answer the problem id associated with the receiver.
37 * NoError if the receiver is a valid binding.
39 public int problemId() {
40 return this.problemReason;
44 * @see org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding#shortReadableName()
46 public char[] shortReadableName() {
47 return readableName();