if (typeBinding.isArray()) {
// the expression returns an array
int idIndex = fUniqueIdIndex++;
String arrayIdentifier = "#a" + idIndex; //$NON-NLS-1$
String varIdentifier = "#i" + idIndex; //$NON-NLS-1$
push(new LocalVariableCreation(arrayIdentifier, typeSignature, 1,
isParamPrimitiveType, true, fCounter));
node.getExpression().accept(this);
storeInstruction();
push(new LocalVariableCreation(varIdentifier,
"I", 0, true, true, fCounter)); //$NON-NLS-1$
push(new PushInt(0));
storeInstruction();
storeInstruction();
push(new LocalVariableCreation(paramIdentifier, typeSignature, 0,
isParamPrimitiveType, false, fCounter));
storeInstruction();
push(new LessOperator(Instruction.T_int, Instruction.T_int,
fCounter));
push(new PushLocalVariable(varIdentifier));
storeInstruction();
push(new PushArrayLength(fCounter));
push(new PushLocalVariable(arrayIdentifier));
storeInstruction();
storeInstruction();
storeInstruction();
// conditional jump will be added here
push(new NoOp(fCounter));
push(new AssignmentOperator(paramTypeId, paramTypeId, fCounter));
push(new PushLocalVariable(paramIdentifier));
storeInstruction();
push(new org.eclipse.jdt.internal.debug.eval.ast.instructions.ArrayAccess(
fCounter));
push(new PushLocalVariable(arrayIdentifier));
storeInstruction();
push(new PostfixPlusPlusOperator(Instruction.T_int, fCounter));
push(new PushLocalVariable(varIdentifier));
storeInstruction();
storeInstruction();
storeInstruction();
if (checkAutoBoxing(typeBinding.getElementType(), paramBinding)) {
storeInstruction();
}
storeInstruction();
addPopInstruction();
node.getBody().accept(this);
storeInstruction();
// jump will be added here
} else {
// the expression returns a collection
String iteratorIdentifier = "#i" + fUniqueIdIndex++; //$NON-NLS-1$
push(new LocalVariableCreation(iteratorIdentifier,
"Ljava/util/Iterator;", 0, false, true, fCounter)); //$NON-NLS-1$
push(new SendMessage(
"iterator", "()Ljava/util/Iterator;", 0, null, fCounter)); //$NON-NLS-1$//$NON-NLS-2$
node.getExpression().accept(this);
storeInstruction();
storeInstruction();
push(new LocalVariableCreation(paramIdentifier, typeSignature, 0,
isParamPrimitiveType, false, fCounter));
storeInstruction();
push(new SendMessage("hasNext", "()Z", 0, null, fCounter)); //$NON-NLS-1$ //$NON-NLS-2$
push(new PushLocalVariable(iteratorIdentifier));