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 { } 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 exists ( ) { } 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 byte [ ] getBytes ( ) throws JavaModelException { } private IBinaryType getJarBinaryTypeInfo ( PackageFragment pkg ) 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 getResource ( ) { } 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 ) { char [ ] contents = mapper . findSource ( getType ( ) , info ) ; if ( contents != null ) { <START_BUG> IBuffer buffer = getBufferManager ( ) . createBuffer ( this ) ; <END_BUG> if ( buffer == null ) return null ; BufferManager bufManager = getBufferManager ( ) ; bufManager . addBuffer ( buffer ) ; if ( ( buffer . getCharacters ( ) ) == null ) { buffer . setContents ( contents ) ; } buffer . addBufferChangedListener ( this ) ; mapper . mapSource ( getType ( ) , contents , info ) ; return buffer ; } return null ; } 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 { } }

Fix:
IBuffer buffer = BufferManager . createBuffer ( this ) ;