Buggy code:
public final class SelectionEngine extends Engine implements ISearchRequestor { SelectionParser parser ; ISearchableNameEnvironment nameEnvironment ; ISelectionRequestor requestor ; CompilationUnitScope unitScope ; boolean acceptedAnswer ; private int actualSelectionStart ; private int actualSelectionEnd ; private char [ ] qualifiedSelection ; private char [ ] selectedIdentifier ; public SelectionEngine ( ISearchableNameEnvironment nameEnvironment , ISelectionRequestor requestor , ConfigurableOption [ ] settings ) { } public void acceptClass ( char [ ] packageName , char [ ] className , int modifiers ) { } public void acceptInterface ( char [ ] packageName , char [ ] interfaceName , int modifiers ) { } public void acceptPackage ( char [ ] packageName ) { } public void acceptType ( char [ ] packageName , char [ ] typeName ) { } private boolean checkSelection ( char [ ] source , int selectionStart , int selectionEnd ) { } public AssistParser getParser ( ) { } private boolean mustQualifyType ( char [ ] [ ] packageName , char [ ] readableTypeName ) { } public void select ( ICompilationUnit sourceUnit , int selectionSourceStart , int selectionSourceEnd ) { } private void selectFrom ( Binding binding ) { } public void selectType ( ISourceType sourceType , char [ ] typeName ) { try { acceptedAnswer = false ; ISourceType outerType = sourceType ; ISourceType parent = sourceType . getEnclosingType ( ) ; while ( parent != null ) { outerType = parent ; parent = parent . getEnclosingType ( ) ; } CompilationResult result = new CompilationResult ( outerType . getFileName ( ) , 1 , 1 ) ; <START_BUG> CompilationUnitDeclaration parsedUnit = SourceTypeConverter . buildCompilationUnit ( outerType , false , true , this . parser . problemReporter ( ) , result ) ; <END_BUG> if ( ( parsedUnit != null ) && ( ( parsedUnit . types ) != null ) ) { char [ ] packageName = sourceType . getPackageName ( ) ; char [ ] sourceTypeName = sourceType . getQualifiedName ( ) ; if ( packageName != null ) { sourceTypeName = CharOperation . subarray ( sourceType . getQualifiedName ( ) , ( ( packageName . length ) + 1 ) , sourceTypeName . length ) ; } TypeDeclaration typeDecl = parsedUnit . declarationOfType ( CharOperation . splitOn ( '.' , sourceTypeName ) ) ; if ( typeDecl != null ) { FieldDeclaration field = new FieldDeclaration ( ) ; int dot ; if ( ( dot = CharOperation . lastIndexOf ( '.' , typeName ) ) == ( - 1 ) ) { this . selectedIdentifier = typeName ; field . type = new SelectionOnSingleTypeReference ( typeName , ( - 1 ) ) ; } else { char [ ] [ ] previousIdentifiers = CharOperation . splitOn ( '.' , typeName , 0 , ( dot - 1 ) ) ; char [ ] selectionIdentifier = CharOperation . subarray ( typeName , ( dot + 1 ) , typeName . length ) ; this . selectedIdentifier = selectionIdentifier ; field . type = new SelectionOnQualifiedTypeReference ( previousIdentifiers , selectionIdentifier , new long [ ( previousIdentifiers . length ) + 1 ] ) ; } field . name = "<fakeField>" . toCharArray ( ) ; typeDecl . fields = new FieldDeclaration [ ] { field } ; lookupEnvironment . buildTypeBindings ( parsedUnit ) ; if ( ( this . unitScope = parsedUnit . scope ) != null ) { try { this . lookupEnvironment . completeTypeBindings ( parsedUnit , true ) ; parsedUnit . scope . faultInTypes ( ) ; parsedUnit . resolve ( ) ; } catch ( SelectionNodeFound e ) { if ( ( e . binding ) != null ) { selectFrom ( e . binding ) ; } } } } } if ( ! ( acceptedAnswer ) ) { if ( ( this . selectedIdentifier ) != null ) { nameEnvironment . findTypes ( typeName , this ) ; } } } catch ( AbortCompilation e ) { } finally { reset ( ) ; } } }

Fix:
CompilationUnitDeclaration parsedUnit = SourceTypeConverter . buildCompilationUnit ( new ISourceType [ ] { outerType } , false , true , this . parser . problemReporter ( ) , result ) ;