Index: LookupEnvironment.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/LookupEnvironment.java,v retrieving revision 1.54 diff -u -r1.54 LookupEnvironment.java --- LookupEnvironment.java 7 Jun 2005 16:46:54 -0000 1.54 +++ LookupEnvironment.java 21 Jun 2005 17:41:22 -0000 @@ -470,11 +470,15 @@ // resolve any array bindings which reference the unresolvedType ReferenceBinding cachedType = packageBinding.getType0(binaryBinding.compoundName[binaryBinding.compoundName.length - 1]); if (cachedType != null) { // update reference to unresolved binding after having read classfile (knows whether generic for raw conversion) - // TODO (kent) suspect the check below is no longer required, since we should not be requesting a binary which is already in the cache - if (cachedType.isBinaryBinding()) // sanity check before the cast... at this point the cache should ONLY contain unresolved types - return (BinaryTypeBinding) cachedType; - - ((UnresolvedReferenceBinding) cachedType).setResolvedType(binaryBinding, this); + if (cachedType instanceof UnresolvedReferenceBinding) { + ((UnresolvedReferenceBinding) cachedType).setResolvedType(binaryBinding, this); + } else { + if (cachedType.isBinaryBinding()) // sanity check... at this point the cache should ONLY contain unresolved types + return (BinaryTypeBinding) cachedType; + // it is possible with a large number of source files (exceeding AbstractImageBuilder.MAX_AT_ONCE) that a member type can be in the cache as an UnresolvedType, + // but because its enclosingType is resolved while its created (call to BinaryTypeBinding constructor), its replaced with a source type + return null; + } } packageBinding.addType(binaryBinding);