Buggy code:
public class DocumentElementParser extends Parser { IDocumentElementRequestor requestor ; private int localIntPtr ; private int lastFieldEndPosition ; private int lastFieldBodyEndPosition ; private int typeStartPosition ; private long selectorSourcePositions ; private int typeDims ; private int extendsDim ; private int declarationSourceStart ; int [ ] [ ] intArrayStack ; int intArrayPtr ; CompilerOptions options ; public DocumentElementParser ( final IDocumentElementRequestor requestor , IProblemFactory problemFactory , CompilerOptions options ) { } public void checkComment ( ) { } protected void consumeClassBodyDeclaration ( ) { } protected void consumeClassDeclaration ( ) { } protected void consumeClassHeader ( ) { } protected void consumeClassHeaderName1 ( ) { } protected void consumeCompilationUnit ( ) { } protected void consumeConstructorDeclaration ( ) { } protected void consumeConstructorHeader ( ) { } protected void consumeConstructorHeaderName ( ) { } protected void consumeDefaultModifiers ( ) { } protected void consumeDiet ( ) { } protected void consumeEnterCompilationUnit ( ) { } protected void consumeEnterVariable ( ) { } protected void consumeExitVariableWithInitialization ( ) { } protected void consumeExitVariableWithoutInitialization ( ) { } protected void consumeFieldDeclaration ( ) { } protected void consumeFormalParameter ( boolean isVarArgs ) { ( identifierLengthPtr ) -- ; char [ ] parameterName = identifierStack [ identifierPtr ] ; long namePositions = identifierPositionStack [ ( ( identifierPtr ) -- ) ] ; int extendedDimensions = this . intStack [ ( ( this . intPtr ) -- ) ] ; int endOfEllipsis = 0 ; if ( isVarArgs ) { endOfEllipsis = this . intStack [ ( ( this . intPtr ) -- ) ] ; } int firstDimensions = this . intStack [ ( ( this . intPtr ) -- ) ] ; final int typeDimensions = firstDimensions + extendedDimensions ; TypeReference type = getTypeReference ( typeDimensions ) ; if ( isVarArgs ) { <START_BUG> type = type . copyDims ( ( typeDimensions + 1 ) ) ; <END_BUG> if ( extendedDimensions == 0 ) { type . sourceEnd = endOfEllipsis ; } type . bits |= ASTNode . IsVarArgs ; } intPtr -= 3 ; Argument arg = new Argument ( parameterName , namePositions , type , intStack [ ( ( intPtr ) + 1 ) ] ) ; int length ; if ( ( length = this . expressionLengthStack [ ( ( this . expressionLengthPtr ) -- ) ] ) != 0 ) { System . arraycopy ( this . expressionStack , ( ( this . expressionPtr -= length ) + 1 ) , ( arg . annotations = new Annotation [ length ] ) , 0 , length ) ; } pushOnAstStack ( arg ) ; ( intArrayPtr ) -- ; } protected void consumeInterfaceDeclaration ( ) { } protected void consumeInterfaceHeader ( ) { } protected void consumeInterfaceHeaderName1 ( ) { } protected void consumeLocalVariableDeclaration ( ) { } protected void consumeMethodDeclaration ( boolean isNotAbstract ) { } protected void consumeMethodHeader ( ) { } protected void consumeMethodHeaderExtendedDims ( ) { } protected void consumeMethodHeaderName ( boolean isAnnotationMethod ) { } protected void consumeModifiers ( ) { } protected void consumePackageDeclarationName ( ) { } protected void consumePackageDeclarationNameWithModifiers ( ) { } protected void consumePushModifiers ( ) { } protected void consumePushRealModifiers ( ) { } protected void consumeSingleStaticImportDeclarationName ( ) { } protected void consumeSingleTypeImportDeclarationName ( ) { } protected void consumeStaticImportOnDemandDeclarationName ( ) { } protected void consumeStaticInitializer ( ) { } protected void consumeStaticOnly ( ) { } protected void consumeTypeImportOnDemandDeclarationName ( ) { } public int flushCommentsDefinedPriorTo ( int position ) { } public CompilationUnitDeclaration endParse ( int act ) { } public void initialize ( ) { } private boolean isLocalDeclaration ( ) { } public void parseCompilationUnit ( ICompilationUnit unit ) { } public void parseConstructor ( char [ ] regionSource ) { } public void parseField ( char [ ] regionSource ) { } public void parseImport ( char [ ] regionSource ) { } public void parseInitializer ( char [ ] regionSource ) { } public void parseMethod ( char [ ] regionSource ) { } public void parsePackage ( char [ ] regionSource ) { } public void parseType ( char [ ] regionSource ) { } public ProblemReporter problemReporter ( ) { } protected void pushOnIntArrayStack ( int [ ] positions ) { } protected void resetModifiers ( ) { } protected boolean resumeOnSyntaxError ( ) { } private char [ ] returnTypeName ( TypeReference type ) { } public String toString ( ) { } protected TypeReference typeReference ( int dim , int localIdentifierPtr , int localIdentifierLengthPtr ) { } }

Fix:
type = copyDims ( type , ( typeDimensions + 1 ) ) ;