Buggy code:
public class CompilationUnit extends Openable implements ICompilationUnit , org . eclipse . jdt . internal . compiler . env . ICompilationUnit , SuffixConstants { public WorkingCopyOwner owner ; protected CompilationUnit ( PackageFragment parent , String name , WorkingCopyOwner owner ) { } public void accept ( ASTVisitor visitor ) throws JavaModelException { } public void becomeWorkingCopy ( IProblemRequestor problemRequestor , IProgressMonitor monitor ) throws JavaModelException { } protected boolean buildStructure ( OpenableElementInfo info , final IProgressMonitor pm , Map newElements , IResource underlyingResource ) throws JavaModelException { if ( ! ( isWorkingCopy ( ) ) ) { if ( ( ( ( ( ( IPackageFragment ) ( getParent ( ) ) ) . getKind ( ) ) == ( IPackageFragmentRoot . K_BINARY ) ) || ( ! ( isValidCompilationUnit ( ) ) ) ) || ( ! ( underlyingResource . isAccessible ( ) ) ) ) { throw newNotPresentException ( ) ; } } if ( ( ! ( isPrimary ( ) ) ) && ( ( getPerWorkingCopyInfo ( ) ) == null ) ) { throw newNotPresentException ( ) ; } CompilationUnitElementInfo unitInfo = ( ( CompilationUnitElementInfo ) ( info ) ) ; IBuffer buffer = getBufferManager ( ) . getBuffer ( this ) ; if ( buffer == null ) { buffer = openBuffer ( pm , unitInfo ) ; } final char [ ] contents = ( buffer == null ) ? null : buffer . getCharacters ( ) ; CompilationUnitStructureRequestor requestor = new CompilationUnitStructureRequestor ( this , unitInfo , newElements ) ; JavaModelManager . PerWorkingCopyInfo perWorkingCopyInfo = getPerWorkingCopyInfo ( ) ; IJavaProject project = getJavaProject ( ) ; boolean computeProblems = ( ( JavaProject . hasJavaNature ( project . getProject ( ) ) ) && ( perWorkingCopyInfo != null ) ) && ( perWorkingCopyInfo . isActive ( ) ) ; IProblemFactory problemFactory = new DefaultProblemFactory ( ) ; Map options = project . getOptions ( true ) ; SourceElementParser parser = new SourceElementParser ( requestor , problemFactory , new CompilerOptions ( options ) , true ) ; parser . reportOnlyOneSyntaxError = ! computeProblems ; requestor . parser = parser ; CompilationUnitDeclaration unit = parser . parseCompilationUnit ( new org . eclipse . jdt . internal . compiler . env . ICompilationUnit ( ) { public char [ ] getContents ( ) { return contents ; } public char [ ] getMainTypeName ( ) { return CompilationUnit . this . getMainTypeName ( ) ; } public char [ ] [ ] getPackageName ( ) { return CompilationUnit . this . getPackageName ( ) ; } public char [ ] getFileName ( ) { return CompilationUnit . this . getFileName ( ) ; } } , true ) ; if ( underlyingResource == null ) { underlyingResource = getResource ( ) ; } unitInfo . timestamp = ( ( IFile ) ( underlyingResource ) ) . getModificationStamp ( ) ; CompilationUnitDeclaration compilationUnitDeclaration = null ; try { if ( computeProblems ) { perWorkingCopyInfo . beginReporting ( ) ; compilationUnitDeclaration = CompilationUnitProblemFinder . process ( unit , this , contents , parser , this . owner , perWorkingCopyInfo , problemFactory , false , pm ) ; perWorkingCopyInfo . endReporting ( ) ; } if ( info instanceof ASTHolderCUInfo ) { int astLevel = ( ( ASTHolderCUInfo ) ( info ) ) . astLevel ; <START_BUG> org . eclipse . jdt . core . dom . CompilationUnit cu = AST . convertCompilationUnit ( astLevel , unit , contents , options , pm ) ; <END_BUG> ( ( ASTHolderCUInfo ) ( info ) ) . ast = cu ; } } finally { if ( compilationUnitDeclaration != null ) { compilationUnitDeclaration . cleanUp ( ) ; } } return unitInfo . isStructureKnown ( ) ; } public boolean canBeRemovedFromCache ( ) { } public boolean canBufferBeRemovedFromCache ( IBuffer buffer ) { } public void close ( ) throws JavaModelException { } protected void closing ( Object info ) { } public void codeComplete ( int offset , ICompletionRequestor requestor ) throws JavaModelException { } public void codeComplete ( int offset , ICompletionRequestor requestor , WorkingCopyOwner workingCopyOwner ) throws JavaModelException { } public void codeComplete ( int offset , final ICodeCompletionRequestor requestor ) throws JavaModelException { } public void codeComplete ( int offset , CompletionRequestor requestor ) throws JavaModelException { } public void codeComplete ( int offset , CompletionRequestor requestor , WorkingCopyOwner wcowner ) throws JavaModelException { } public IJavaElement [ ] codeSelect ( int offset , int length ) throws JavaModelException { } public IJavaElement [ ] codeSelect ( int offset , int length , WorkingCopyOwner workingCopyOwner ) throws JavaModelException { } public void commit ( boolean force , IProgressMonitor monitor ) throws JavaModelException { } public void commitWorkingCopy ( boolean force , IProgressMonitor monitor ) throws JavaModelException { } public void copy ( IJavaElement container , IJavaElement sibling , String rename , boolean force , IProgressMonitor monitor ) throws JavaModelException { } protected Object createElementInfo ( ) { } public IImportDeclaration createImport ( String importName , IJavaElement sibling , IProgressMonitor monitor ) throws JavaModelException { } public IImportDeclaration createImport ( String importName , IJavaElement sibling , int flags , IProgressMonitor monitor ) throws JavaModelException { } public IPackageDeclaration createPackageDeclaration ( String pkg , IProgressMonitor monitor ) throws JavaModelException { } public IType createType ( String content , IJavaElement sibling , boolean force , IProgressMonitor monitor ) throws JavaModelException { } public void delete ( boolean force , IProgressMonitor monitor ) throws JavaModelException { } public void destroy ( ) { } public void discardWorkingCopy ( ) throws JavaModelException { } public boolean equals ( Object obj ) { } protected boolean equalsDOMNode ( IDOMNode node ) { } public boolean exists ( ) { } public IJavaElement [ ] findElements ( IJavaElement element ) { } public IType findPrimaryType ( ) { } public IJavaElement findSharedWorkingCopy ( IBufferFactory factory ) { } public ICompilationUnit findWorkingCopy ( WorkingCopyOwner workingCopyOwner ) { }

Fix:
org . eclipse . jdt . core . dom . CompilationUnit cu = AST . convertCompilationUnit ( astLevel , unit , contents , options , computeProblems , pm ) ;