Buggy code:
public class CodeSnippetParser extends Parser implements EvaluationConstants { int codeSnippetStart ; int codeSnippetEnd ; boolean hasRecoveredOnExpression ; int problemCountBeforeRecovery = 0 ; int lastStatement = - 1 ; EvaluationContext evaluationContext ; public CodeSnippetParser ( ProblemReporter problemReporter , EvaluationContext evaluationContext , boolean optimizeStringLiterals , boolean assertMode , int codeSnippetStart , int codeSnippetEnd ) { } protected void classInstanceCreation ( boolean alwaysQualified ) { } protected void consumeClassDeclaration ( ) { } protected void consumeClassHeaderName ( ) { } protected void consumeEmptyStatement ( ) { } protected void consumeExpressionStatement ( ) { } protected void consumeFieldAccess ( boolean isSuperAccess ) { } protected void consumeInterfaceHeaderName ( ) { } protected void consumeLocalVariableDeclarationStatement ( ) { } protected void consumeMethodDeclaration ( boolean isNotAbstract ) { super . consumeMethodDeclaration ( isNotAbstract ) ; MethodDeclaration methodDecl = ( ( MethodDeclaration ) ( astStack [ astPtr ] ) ) ; if ( this . isTopLevelType ( ) ) { int last = ( ( methodDecl . statements ) == null ) ? - 1 : ( methodDecl . statements . length ) - 1 ; if ( ( last >= 0 ) && ( ( methodDecl . statements [ last ] ) instanceof Expression ) ) { Expression lastExpression = ( ( Expression ) ( methodDecl . statements [ last ] ) ) ; methodDecl . statements [ last ] = new CodeSnippetReturnStatement ( lastExpression , lastExpression . sourceStart ( ) , lastExpression . sourceEnd ( ) , evaluationContext ) ; } } int start = ( methodDecl . bodyStart ) - 1 ; int end = start ; long position = ( start << 32 ) + end ; long [ ] positions = new long [ ] { position } ; if ( ( this . evaluationContext . localVariableNames ) != null ) { int varCount = this . evaluationContext . localVariableNames . length ; Statement [ ] newStatements = new Statement [ varCount + 1 ] ; for ( int i = 0 ; i < varCount ; i ++ ) { char [ ] trimmedTypeName = this . evaluationContext . localVariableTypeNames [ i ] ; int nameEnd = CharOperation . indexOf ( '[' , trimmedTypeName ) ; if ( nameEnd >= 0 ) trimmedTypeName = CharOperation . subarray ( trimmedTypeName , 0 , nameEnd ) ; nameEnd = CharOperation . indexOf ( '<seq2seq4repair_space>' , trimmedTypeName ) ; if ( nameEnd >= 0 ) trimmedTypeName = CharOperation . subarray ( trimmedTypeName , 0 , nameEnd ) ; TypeReference typeReference = new QualifiedTypeReference ( CharOperation . splitOn ( '.' , trimmedTypeName ) , positions ) ; int dimCount = CharOperation . occurencesOf ( '[' , this . evaluationContext . localVariableTypeNames [ i ] ) ; if ( dimCount > 0 ) { <START_BUG> typeReference = typeReference . copyDims ( dimCount ) ; <END_BUG> } NameReference init = new SingleNameReference ( CharOperation . concat ( EvaluationConstants . LOCAL_VAR_PREFIX , this . evaluationContext . localVariableNames [ i ] ) , position ) ; LocalDeclaration declaration = new LocalDeclaration ( init , this . evaluationContext . localVariableNames [ i ] , start , end ) ; declaration . type = typeReference ; declaration . modifiers = this . evaluationContext . localVariableModifiers [ i ] ; newStatements [ i ] = declaration ; } TryStatement tryStatement = new TryStatement ( ) ; Block tryBlock = new Block ( methodDecl . explicitDeclarations ) ; tryBlock . sourceStart = start ; tryBlock . sourceEnd = end ; tryBlock . statements = methodDecl . statements ; tryStatement . tryBlock = tryBlock ; Block finallyBlock = new Block ( 0 ) ; finallyBlock . sourceStart = start ; finallyBlock . sourceEnd = end ; finallyBlock . statements = new Statement [ varCount ] ; for ( int i = 0 ; i < varCount ; i ++ ) { finallyBlock . statements [ i ] = new Assignment ( new SingleNameReference ( CharOperation . concat ( EvaluationConstants . LOCAL_VAR_PREFIX , this . evaluationContext . localVariableNames [ i ] ) , position ) , new SingleNameReference ( this . evaluationContext . localVariableNames [ i ] , position ) , ( ( int ) ( position ) ) ) ; } tryStatement . finallyBlock = finallyBlock ; newStatements [ varCount ] = tryStatement ; methodDecl . statements = newStatements ; } } protected void consumeMethodInvocationName ( ) { } protected void consumeMethodInvocationSuper ( ) { } protected void consumePrimaryNoNewArrayThis ( ) { } protected void consumeStatementBreak ( ) { } protected void consumeStatementBreakWithLabel ( ) { } protected void consumeStatementCatch ( ) { } protected void consumeStatementContinue ( ) { } protected void consumeStatementContinueWithLabel ( ) { } protected void consumeStatementDo ( ) { } protected void consumeStatementFor ( ) { } protected void consumeStatementIfNoElse ( ) { } protected void consumeStatementIfWithElse ( ) { } protected void consumeStatementLabel ( ) { } protected void consumeStatementReturn ( ) { } protected void consumeStatementSwitch ( ) { } protected void consumeStatementSynchronized ( ) { } protected void consumeStatementThrow ( ) { } protected void consumeStatementTry ( boolean arg_0 ) { } protected void consumeStatementWhile ( ) { } protected CompilationUnitDeclaration endParse ( int act ) { } protected NameReference getUnspecifiedReference ( ) { } protected NameReference getUnspecifiedReferenceOptimized ( ) { } protected void ignoreExpressionAssignment ( ) { } private boolean isTopLevelType ( ) { } protected MessageSend newMessageSend ( ) { } private void recordLastStatementIfNeeded ( ) { } protected void reportSyntaxError ( int act , int currentKind , int stateStackTop ) { } protected boolean resumeOnSyntaxError ( ) { } }

Fix:
typeReference = this . copyDims ( typeReference , dimCount ) ;