public void resolve(BlockScope upperScope) {
// use the scope that will hold the init declarations
this.scope = new BlockScope(upperScope);
this.elementVariable.resolve(this.scope); // collection expression can see itemVariable
TypeBinding elementType = this.elementVariable.type.resolvedType;
TypeBinding collectionType = this.collection == null ? null : this.collection.resolveType(this.scope);
TypeBinding expectedCollectionType = null;
if (elementType != null && collectionType != null) {
boolean isTargetJsr14 = this.scope.compilerOptions().targetJDK == ClassFileConstants.JDK1_4;
if (collectionType.isArrayType()) { // for(E e : E[])
this.kind = ARRAY;
this.collectionElementType = ((ArrayBinding) collectionType).elementsType();