Buggy code:
public void delete ( boolean force , IProgressMonitor monitor ) throws JavaModelException { } public void destroy ( ) { } public void discardWorkingCopy ( ) throws JavaModelException { } public boolean equals ( Object obj ) { } public boolean exists ( ) { } public IJavaElement [ ] findElements ( IJavaElement element ) { } public IType findPrimaryType ( ) { } public IJavaElement findSharedWorkingCopy ( IBufferFactory factory ) { } public ICompilationUnit findWorkingCopy ( WorkingCopyOwner workingCopyOwner ) { } public IType [ ] getAllTypes ( ) throws JavaModelException { } public ICompilationUnit getCompilationUnit ( ) { } public char [ ] getContents ( ) { } public IResource getCorrespondingResource ( ) throws JavaModelException { } public IJavaElement getElementAt ( int position ) throws JavaModelException { } public String getElementName ( ) { } public int getElementType ( ) { } public char [ ] getFileName ( ) { } public IJavaElement getHandleFromMemento ( String token , MementoTokenizer memento , WorkingCopyOwner workingCopyOwner ) { } protected char getHandleMementoDelimiter ( ) { } public IImportDeclaration getImport ( String importName ) { } public IImportContainer getImportContainer ( ) { } public IImportDeclaration [ ] getImports ( ) throws JavaModelException { } public ITypeRoot getTypeRoot ( ) { } public char [ ] getMainTypeName ( ) { } public IJavaElement getOriginal ( IJavaElement workingCopyElement ) { } public IJavaElement getOriginalElement ( ) { } public WorkingCopyOwner getOwner ( ) { } public IPackageDeclaration getPackageDeclaration ( String pkg ) { } public IPackageDeclaration [ ] getPackageDeclarations ( ) throws JavaModelException { } public char [ ] [ ] getPackageName ( ) { } public IPath getPath ( ) { } public JavaModelManager . PerWorkingCopyInfo getPerWorkingCopyInfo ( ) { } public ICompilationUnit getPrimary ( ) { } public IJavaElement getPrimaryElement ( boolean checkOwner ) { } public IResource getResource ( ) { } public String getSource ( ) throws JavaModelException { } public ISourceRange getSourceRange ( ) throws JavaModelException { } public IType getType ( String typeName ) { } public IType [ ] getTypes ( ) throws JavaModelException { } public IResource getUnderlyingResource ( ) throws JavaModelException { } public IJavaElement getSharedWorkingCopy ( IProgressMonitor pm , IBufferFactory factory , IProblemRequestor problemRequestor ) throws JavaModelException { } public IJavaElement getWorkingCopy ( ) throws JavaModelException { } public ICompilationUnit getWorkingCopy ( IProgressMonitor monitor ) throws JavaModelException { } public ICompilationUnit getWorkingCopy ( WorkingCopyOwner workingCopyOwner , IProgressMonitor monitor ) throws JavaModelException { } public IJavaElement getWorkingCopy ( IProgressMonitor monitor , IBufferFactory factory , IProblemRequestor problemRequestor ) throws JavaModelException { } public ICompilationUnit getWorkingCopy ( WorkingCopyOwner workingCopyOwner , IProblemRequestor problemRequestor , IProgressMonitor monitor ) throws JavaModelException { } protected boolean hasBuffer ( ) { } public boolean hasResourceChanged ( ) { } public boolean isBasedOn ( IResource resource ) { } public boolean isConsistent ( ) { } public boolean isPrimary ( ) { } protected boolean isSourceElement ( ) { } protected IStatus validateCompilationUnit ( IResource resource ) { } public boolean isWorkingCopy ( ) { } public void makeConsistent ( IProgressMonitor monitor ) throws JavaModelException { } public org . eclipse . jdt . core . dom . CompilationUnit makeConsistent ( int astLevel , boolean resolveBindings , boolean statementsRecovery , HashMap problems , IProgressMonitor monitor ) throws JavaModelException { } public void move ( IJavaElement container , IJavaElement sibling , String rename , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected IBuffer openBuffer ( IProgressMonitor pm , Object info ) throws JavaModelException { BufferManager bufManager = getBufferManager ( ) ; boolean isWorkingCopy = isWorkingCopy ( ) ; <START_BUG> IBuffer buffer = ( isWorkingCopy ) ? this . owner . createBuffer ( this ) : bufManager . createBuffer ( this ) ; <END_BUG> if ( buffer == null ) return null ; synchronized ( bufManager ) { IBuffer existingBuffer = bufManager . getBuffer ( this ) ; if ( existingBuffer != null ) return existingBuffer ; if ( ( buffer . getCharacters ( ) ) == null ) { if ( isWorkingCopy ) { ICompilationUnit original ; if ( ( ! ( isPrimary ( ) ) ) && ( ( original = new CompilationUnit ( ( ( PackageFragment ) ( getParent ( ) ) ) , getElementName ( ) , DefaultWorkingCopyOwner . PRIMARY ) ) . isOpen ( ) ) ) { buffer . setContents ( original . getSource ( ) ) ; } else { IFile file = ( ( IFile ) ( getResource ( ) ) ) ; if ( ( file == null ) || ( ! ( file . exists ( ) ) ) ) { buffer . setContents ( CharOperation . NO_CHAR ) ; } else { buffer . setContents ( Util . getResourceContentsAsCharArray ( file ) ) ; } } } else { IFile file = ( ( IFile ) ( this . getResource ( ) ) ) ; if ( ( file == null ) || ( ! ( file . exists ( ) ) ) ) throw newNotPresentException ( ) ; buffer . setContents ( Util . getResourceContentsAsCharArray ( file ) ) ; } } bufManager . addBuffer ( buffer ) ; buffer . addBufferChangedListener ( this ) ; } return buffer ; } protected void openParent ( Object childInfo , HashMap newElements , IProgressMonitor pm ) throws JavaModelException { } public IMarker [ ] reconcile ( ) throws JavaModelException { } public void reconcile ( boolean forceProblemDetection , IProgressMonitor monitor ) throws JavaModelException { } public org . eclipse . jdt . core . dom . CompilationUnit reconcile ( int astLevel , boolean forceProblemDetection , WorkingCopyOwner workingCopyOwner , IProgressMonitor monitor ) throws JavaModelException { } public org . eclipse . jdt . core . dom . CompilationUnit reconcile ( int astLevel , boolean forceProblemDetection , boolean enableStatementsRecovery , WorkingCopyOwner workingCopyOwner , IProgressMonitor monitor ) throws JavaModelException { } public void rename ( String newName , boolean force , IProgressMonitor monitor ) throws JavaModelException { }

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