}
protected void consumeClassInstanceCreationExpressionQualifiedWithTypeArguments() {
// ClassInstanceCreationExpression ::= Primary '.' 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt
// ClassInstanceCreationExpression ::= ClassInstanceCreationExpressionName 'new' TypeArguments SimpleName '(' ArgumentListopt ')' ClassBodyopt
QualifiedAllocationExpression alloc;
int length;
if (((length = this.astLengthStack[this.astLengthPtr]) == 1) && (this.astStack[this.astPtr] == null)) {
if (this.indexOfAssistIdentifier() < 0) {
super.consumeClassInstanceCreationExpressionQualifiedWithTypeArguments();
return;
}
//NO ClassBody
this.astPtr--;
this.astLengthPtr--;
alloc = new SelectionOnQualifiedAllocationExpression();
alloc.sourceEnd = this.endPosition; //the position has been stored explicitly
if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {
this.expressionPtr -= length;
System.arraycopy(
this.expressionStack,
this.expressionPtr + 1,
alloc.arguments = new Expression[length],
0,
length);
}
// trick to avoid creating a selection on type reference
char [] oldIdent = assistIdentifier();
setAssistIdentifier(null);
alloc.type = getTypeReference(0);
checkForDiamond(alloc.type);
setAssistIdentifier(oldIdent);
length = this.genericsLengthStack[this.genericsLengthPtr--];
this.genericsPtr -= length;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, alloc.typeArguments = new TypeReference[length], 0, length);
this.intPtr--; // remove the position of the '<'
//the default constructor with the correct number of argument
//will be created and added by the TC (see createsInternalConstructorWithBinding)
alloc.sourceStart = this.intStack[this.intPtr--];
pushOnExpressionStack(alloc);
this.assistNode = alloc;
this.lastCheckPoint = alloc.sourceEnd + 1;
if (!this.diet){
this.restartRecovery = true; // force to restart in recovery mode
this.lastIgnoredToken = -1;
}
this.isOrphanCompletionNode = true;
} else {
super.consumeClassInstanceCreationExpressionQualifiedWithTypeArguments();
}
this.expressionLengthPtr--;
QualifiedAllocationExpression qae =
(QualifiedAllocationExpression) this.expressionStack[this.expressionPtr--];
qae.enclosingInstance = this.expressionStack[this.expressionPtr];
this.expressionStack[this.expressionPtr] = qae;
qae.sourceStart = qae.enclosingInstance.sourceStart;
}