Buggy code:
public class ClassFile extends Openable implements IClassFile , SuffixConstants { protected String name ; protected BinaryType binaryType = null ; protected ClassFile ( PackageFragment parent , String nameWithoutExtension ) { } public ICompilationUnit becomeWorkingCopy ( IProblemRequestor problemRequestor , WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { } protected boolean buildStructure ( OpenableElementInfo info , IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException { } public void codeComplete ( int offset , ICompletionRequestor requestor ) throws JavaModelException { } public void codeComplete ( int offset , ICompletionRequestor requestor , WorkingCopyOwner owner ) throws JavaModelException { } public void codeComplete ( int offset , CompletionRequestor requestor ) throws JavaModelException { } public void codeComplete ( int offset , CompletionRequestor requestor , WorkingCopyOwner owner ) throws JavaModelException { String source = getSource ( ) ; if ( source != null ) { BinaryType type = ( ( BinaryType ) ( getType ( ) ) ) ; BasicCompilationUnit cu = new BasicCompilationUnit ( getSource ( ) . toCharArray ( ) , null , type . sourceFileName ( ( ( IBinaryType ) ( type . getElementInfo ( ) ) ) ) , getJavaProject ( ) ) ; <START_BUG> codeComplete ( cu , cu , offset , requestor , owner ) ; <END_BUG> } } public IJavaElement [ ] codeSelect ( int offset , int length ) throws JavaModelException { } public IJavaElement [ ] codeSelect ( int offset , int length , WorkingCopyOwner owner ) throws JavaModelException { } protected Object createElementInfo ( ) { } public boolean equals ( Object o ) { } public boolean existsUsingJarTypeCache ( ) { } protected IJavaElement findElement ( IJavaElement elt , int position , SourceMapper mapper ) { } public IType findPrimaryType ( ) { } public String getAttachedJavadoc ( IProgressMonitor monitor ) throws JavaModelException { } public IBinaryType getBinaryTypeInfo ( IFile file ) throws JavaModelException { } public IBinaryType getBinaryTypeInfo ( IFile file , boolean fullyInitialize ) throws JavaModelException { } public byte [ ] getBytes ( ) throws JavaModelException { } private IBinaryType getJarBinaryTypeInfo ( PackageFragment pkg , boolean fullyInitialize ) throws IOException , CoreException , ClassFormatException { } public IBuffer getBuffer ( ) throws JavaModelException { } public IClassFile getClassFile ( ) { } public ITypeRoot getTypeRoot ( ) { } public IResource getCorrespondingResource ( ) throws JavaModelException { } public IJavaElement getElementAt ( int position ) throws JavaModelException { } public IJavaElement getElementAtConsideringSibling ( int position ) throws JavaModelException { } public String getElementName ( ) { } public int getElementType ( ) { } public IJavaElement getHandleFromMemento ( String token , MementoTokenizer memento , WorkingCopyOwner owner ) { } protected char getHandleMementoDelimiter ( ) { } public IPath getPath ( ) { } public IResource resource ( PackageFragmentRoot root ) { } public String getSource ( ) throws JavaModelException { } public ISourceRange getSourceRange ( ) throws JavaModelException { } public String getTopLevelTypeName ( ) { } public IType getType ( ) { } public String getTypeName ( ) { } public ICompilationUnit getWorkingCopy ( WorkingCopyOwner owner , IProgressMonitor monitor ) throws JavaModelException { } public IJavaElement getWorkingCopy ( IProgressMonitor monitor , IBufferFactory factory ) throws JavaModelException { } protected boolean hasBuffer ( ) { } public int hashCode ( ) { } public boolean isClass ( ) throws JavaModelException { } public boolean isInterface ( ) throws JavaModelException { } public boolean isReadOnly ( ) { } private IStatus validateClassFile ( ) { } protected IBuffer openBuffer ( IProgressMonitor pm , Object info ) throws JavaModelException { } private IBuffer mapSource ( SourceMapper mapper , IBinaryType info ) { } static String simpleName ( char [ ] className ) { } public static char [ ] translatedName ( char [ ] name ) { } static char [ ] [ ] translatedNames ( char [ ] [ ] names ) { } static char [ ] unqualifiedName ( char [ ] className ) { } public void codeComplete ( int offset , final ICodeCompletionRequestor requestor ) throws JavaModelException { } protected IStatus validateExistence ( IResource underlyingResource ) { } }

Fix:
codeComplete ( cu , cu , offset , requestor , owner , null ) ;