public class PackageBinding extends Binding implements TypeConstants {
public char[][] compoundName;
PackageBinding parent;
- LookupEnvironment environment;
+ public LookupEnvironment environment;
HashtableOfType knownTypes;
HashtableOfPackage knownPackages;
protected PackageBinding() {
* Answer the receiver's binding type from Binding.BindingID.
*/
-public final int bindingType() {
- return PACKAGE;
+public final int kind() {
+ return Binding.PACKAGE;
+}
+/*
+ * slash separated name
+ * org.eclipse.jdt.core --> org/eclipse/jdt/core
+ */
+public char[] computeUniqueKey() {
+ return CharOperation.concatWith(compoundName, '/');
}
private PackageBinding findPackage(char[] name) {
if (!environment.isPackage(this.compoundName, name))
*/
ReferenceBinding getType(char[] name) {
- ReferenceBinding binding = getType0(name);
- if (binding == null) {
- if ((binding = environment.askForType(this, name)) == null) {
+ ReferenceBinding typeBinding = getType0(name);
+ if (typeBinding == null) {
+ if ((typeBinding = environment.askForType(this, name)) == null) {
// not found so remember a problem type binding in the cache for future lookups
addNotFoundType(name);
return null;
}
}
- if (binding == LookupEnvironment.TheNotFoundType)
+ if (typeBinding == LookupEnvironment.TheNotFoundType)
return null;
- if (binding instanceof UnresolvedReferenceBinding)
- binding = ((UnresolvedReferenceBinding) binding).resolve(environment);
- if (binding.isNestedType())
+
+ typeBinding = BinaryTypeBinding.resolveType(typeBinding, environment, false); // no raw conversion for now
+ if (typeBinding.isNestedType())
return new ProblemReferenceBinding(name, InternalNameProvided);
- return binding;
+ return typeBinding;
}
/* Answer the type named name if it exists in the cache.
* Answer theNotFoundType if it could not be resolved the first time
public Binding getTypeOrPackage(char[] name) {
ReferenceBinding typeBinding = getType0(name);
if (typeBinding != null && typeBinding != LookupEnvironment.TheNotFoundType) {
- if (typeBinding instanceof UnresolvedReferenceBinding)
- typeBinding = ((UnresolvedReferenceBinding) typeBinding).resolve(environment);
+ typeBinding = BinaryTypeBinding.resolveType(typeBinding, environment, false); // no raw conversion for now
if (typeBinding.isNestedType())
return new ProblemReferenceBinding(name, InternalNameProvided);
return typeBinding;