Buggy code:
public final class SelectionEngine extends Engine implements ISearchRequestor { public static boolean DEBUG = false ; SelectionParser parser ; ISelectionRequestor requestor ; boolean acceptedAnswer ; private int actualSelectionStart ; private int actualSelectionEnd ; private char [ ] qualifiedSelection ; private char [ ] selectedIdentifier ; private char [ ] [ ] [ ] acceptedClasses ; private char [ ] [ ] [ ] acceptedInterfaces ; int acceptedClassesCount ; int acceptedInterfacesCount ; public SelectionEngine ( ISearchableNameEnvironment nameEnvironment , ISelectionRequestor requestor , Map settings ) { } public void acceptClass ( char [ ] packageName , char [ ] className , int modifiers ) { } public void acceptInterface ( char [ ] packageName , char [ ] interfaceName , int modifiers ) { } public void acceptPackage ( char [ ] packageName ) { } private void acceptQualifiedTypes ( ) { } public void acceptType ( char [ ] packageName , char [ ] typeName ) { } private boolean checkSelection ( char [ ] source , int selectionStart , int selectionEnd ) { } public AssistParser getParser ( ) { } public void select ( ICompilationUnit sourceUnit , int selectionSourceStart , int selectionSourceEnd ) { } private void selectFrom ( Binding binding ) { } public void selectType ( ISourceType sourceType , char [ ] typeName , ISourceType [ ] topLevelTypes , boolean searchInEnvironment ) { 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 , this . compilerOptions . maxProblemsPerUnit ) ; CompilationUnitDeclaration parsedUnit = SourceTypeConverter . buildCompilationUnit ( topLevelTypes , false , true , false , this . parser . problemReporter ( ) , result ) ; if ( ( parsedUnit != null ) && ( ( parsedUnit . types ) != null ) ) { if ( SelectionEngine . DEBUG ) { System . out . println ( "SELECTION<seq2seq4repair_space>-<seq2seq4repair_space>Diet<seq2seq4repair_space>AST<seq2seq4repair_space>:" ) ; System . out . println ( parsedUnit . toString ( ) ) ; } 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 { qualifiedSelection = typeName ; <START_BUG> char [ ] [ ] previousIdentifiers = CharOperation . splitOn ( '.' , typeName , 0 , ( dot - 1 ) ) ; <END_BUG> 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 ) { if ( SelectionEngine . DEBUG ) { System . out . println ( "SELECTION<seq2seq4repair_space>-<seq2seq4repair_space>Selection<seq2seq4repair_space>binding<seq2seq4repair_space>:" ) ; System . out . println ( e . binding . toString ( ) ) ; } selectFrom ( e . binding ) ; } } } } } if ( ( ! ( acceptedAnswer ) ) && searchInEnvironment ) { if ( ( this . selectedIdentifier ) != null ) { nameEnvironment . findTypes ( typeName , this ) ; if ( ! ( acceptedAnswer ) ) { acceptQualifiedTypes ( ) ; } } } } catch ( AbortCompilation e ) { } finally { qualifiedSelection = null ; reset ( ) ; } } private void selectDeclaration ( CompilationUnitDeclaration compilationUnit ) { } private void selectDeclaration ( TypeDeclaration typeDeclaration , char [ ] assistIdentifier ) { } }

Fix:
char [ ] [ ] previousIdentifiers = CharOperation . splitOn ( '.' , typeName , 0 , dot ) ;