Buggy code:
public class BinaryType extends BinaryMember implements IType { private static final IField [ ] NO_FIELDS = new IField [ 0 ] ; private static final IMethod [ ] NO_METHODS = new IMethod [ 0 ] ; private static final IType [ ] NO_TYPES = new IType [ 0 ] ; private static final IInitializer [ ] NO_INITIALIZERS = new IInitializer [ 0 ] ; private static final String [ ] NO_STRINGS = new String [ 0 ] ; protected BinaryType ( IJavaElement parent , String name ) { } public void close ( ) throws JavaModelException { } protected void closing ( Object info ) throws JavaModelException { } public void codeComplete ( char [ ] snippet , int insertion , int position , char [ ] [ ] localVariableTypeNames , char [ ] [ ] localVariableNames , int [ ] localVariableModifiers , boolean isStatic , ICompletionRequestor requestor ) throws JavaModelException { if ( requestor == null ) { throw new IllegalArgumentException ( Util . bind ( "codeAssist.nullRequestor" ) ) ; } SearchableEnvironment environment = ( ( SearchableEnvironment ) ( ( ( JavaProject ) ( getJavaProject ( ) ) ) . getSearchableNameEnvironment ( ) ) ) ; NameLookup nameLookup = ( ( JavaProject ) ( getJavaProject ( ) ) ) . getNameLookup ( ) ; CompletionEngine engine = new CompletionEngine ( environment , new CompletionRequestorWrapper ( requestor , nameLookup ) , JavaCore . getOptions ( ) ) ; String source = getClassFile ( ) . getSource ( ) ; if ( ( ( source != null ) && ( insertion > ( - 1 ) ) ) && ( insertion < ( source . length ( ) ) ) ) { String encoding = ( ( String ) ( JavaCore . getOptions ( ) . get ( CompilerOptions . OPTION_Encoding ) ) ) ; if ( "" . equals ( encoding ) ) encoding = null ; char [ ] prefix = CharOperation . concat ( source . substring ( 0 , insertion ) . toCharArray ( ) , new char [ ] { '{' } ) ; <START_BUG> char [ ] suffix = CharOperation . concat ( source . substring ( insertion ) . toCharArray ( ) , new char [ ] { '}' } ) ; <END_BUG> char [ ] fakeSource = CharOperation . concat ( prefix , snippet , suffix ) ; BasicCompilationUnit cu = new BasicCompilationUnit ( fakeSource , getElementName ( ) , encoding ) ; engine . complete ( cu , ( ( prefix . length ) + position ) , prefix . length ) ; } else { engine . complete ( this , snippet , position , localVariableTypeNames , localVariableNames , localVariableModifiers , isStatic ) ; } } public IField createField ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { } public IInitializer createInitializer ( String contents , IJavaElement sibling , IProgressMonitor monitor ) throws JavaModelException { } public IMethod createMethod ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { } public IType createType ( String contents , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { } public IMethod [ ] findMethods ( IMethod method ) { } public IJavaElement [ ] getChildren ( ) throws JavaModelException { } protected ClassFileInfo getClassFileInfo ( ) throws JavaModelException { } public IType getDeclaringType ( ) { } public IField getField ( String name ) { } public IField [ ] getFields ( ) throws JavaModelException { } public int getFlags ( ) throws JavaModelException { } public String getFullyQualifiedName ( ) { } public String getFullyQualifiedName ( char enclosingTypeSeparator ) { } public IInitializer getInitializer ( int occurrenceCount ) { } public IInitializer [ ] getInitializers ( ) { } public IMethod getMethod ( String name , String [ ] parameterTypeSignatures ) { } public IMethod [ ] getMethods ( ) throws JavaModelException { } public IPackageFragment getPackageFragment ( ) { } public String getSuperclassName ( ) throws JavaModelException { } public String [ ] getSuperInterfaceNames ( ) throws JavaModelException { } public IType getType ( String name ) { } public String getTypeQualifiedName ( ) { } public String getTypeQualifiedName ( char enclosingTypeSeparator ) { } public IType [ ] getTypes ( ) throws JavaModelException { } public boolean hasChildren ( ) throws JavaModelException { } public boolean isClass ( ) throws JavaModelException { } public boolean isInterface ( ) throws JavaModelException { } public ITypeHierarchy newSupertypeHierarchy ( IProgressMonitor monitor ) throws JavaModelException { } public ITypeHierarchy newTypeHierarchy ( IProgressMonitor monitor ) throws JavaModelException { } public ITypeHierarchy newTypeHierarchy ( IJavaProject project , IProgressMonitor monitor ) throws JavaModelException { } protected void removeInfo ( ) { } public String [ ] [ ] resolveType ( String typeName ) throws JavaModelException { } protected void toStringInfo ( int tab , StringBuffer buffer , Object info ) { } }

Fix:
char [ ] suffix = CharOperation . concat ( new char [ ] { '}' } , source . substring ( insertion ) . toCharArray ( ) ) ;