1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 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 net.sourceforge.phpdt.internal.compiler.lookup;
13 import net.sourceforge.phpdt.core.compiler.CharOperation;
15 public class UnresolvedReferenceBinding extends ReferenceBinding {
16 ReferenceBinding resolvedType;
18 UnresolvedReferenceBinding(char[][] compoundName,
19 PackageBinding packageBinding) {
20 this.compoundName = compoundName;
21 this.fPackage = packageBinding;
28 ReferenceBinding resolve(LookupEnvironment environment) {
29 if (resolvedType != null)
32 ReferenceBinding environmentType = fPackage
33 .getType0(compoundName[compoundName.length - 1]);
34 if (environmentType == this)
35 environmentType = environment.askForType(compoundName);
36 if (environmentType != null && environmentType != this) { // could not
45 resolvedType = environmentType;
46 environment.updateArrayCache(this, environmentType);
47 return environmentType; // when found, it replaces the unresolved
51 environment.problemReporter.isClassPathCorrect(compoundName, null);
52 return null; // will not get here since the above error aborts the
56 public String toString() {
57 return "Unresolved type " + ((compoundName != null) ? CharOperation.toString(compoundName) : "UNNAMED"); //$NON-NLS-1$ //$NON-NLS-2$