}
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)) {
//NO ClassBody
this.astPtr--;
alloc = new QualifiedAllocationExpression();
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);
}
alloc.type = getTypeReference(0);
checkForDiamond(alloc.type);
length = this.genericsLengthStack[this.genericsLengthPtr--];
this.genericsPtr -= length;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, alloc.typeArguments = new TypeReference[length], 0, length);
this.intPtr--;
//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);
} else {
dispatchDeclarationInto(length);
TypeDeclaration anonymousTypeDeclaration = (TypeDeclaration)this.astStack[this.astPtr];
anonymousTypeDeclaration.declarationSourceEnd = this.endStatementPosition;
anonymousTypeDeclaration.bodyEnd = this.endStatementPosition;
if (length == 0 && !containsComment(anonymousTypeDeclaration.bodyStart, anonymousTypeDeclaration.bodyEnd)) {
anonymousTypeDeclaration.bits |= ASTNode.UndocumentedEmptyBlock;
}
this.astPtr--;
this.astLengthPtr--;
QualifiedAllocationExpression allocationExpression = anonymousTypeDeclaration.allocation;
if (allocationExpression != null) {
allocationExpression.sourceEnd = this.endStatementPosition;
// handle type arguments
length = this.genericsLengthStack[this.genericsLengthPtr--];
this.genericsPtr -= length;
System.arraycopy(this.genericsStack, this.genericsPtr + 1, allocationExpression.typeArguments = new TypeReference[length], 0, length);
allocationExpression.sourceStart = this.intStack[this.intPtr--];
checkForDiamond(allocationExpression.type);
}
}
QualifiedAllocationExpression qae =
(QualifiedAllocationExpression) this.expressionStack[this.expressionPtr];
if (qae.anonymousType == null) {
this.expressionLengthPtr--;
this.expressionPtr--;