Buggy code:
public class EvaluationContext implements SuffixConstants , EvaluationConstants { static final boolean TIMING = false ; static int VAR_CLASS_COUNTER = 0 ; static int CODE_SNIPPET_COUNTER = 0 ; GlobalVariable [ ] variables ; int variableCount ; char [ ] [ ] imports ; char [ ] packageName ; boolean varsChanged ; VariablesInfo installedVars ; IBinaryType codeSnippetBinary ; String lineSeparator ; char [ ] declaringTypeName ; int [ ] localVariableModifiers ; char [ ] [ ] localVariableTypeNames ; char [ ] [ ] localVariableNames ; boolean isStatic ; boolean isConstructorCall ; public EvaluationContext ( ) { } public GlobalVariable [ ] allVariables ( ) { } public void complete ( char [ ] codeSnippet , int completionPosition , SearchableEnvironment environment , CompletionRequestor requestor , Map options , IJavaProject project ) { final char [ ] className = "CodeSnippetCompletion" . toCharArray ( ) ; final CodeSnippetToCuMapper mapper = new CodeSnippetToCuMapper ( codeSnippet , this . packageName , this . imports , className , ( ( this . installedVars ) == null ? null : this . installedVars . className ) , this . localVariableNames , this . localVariableTypeNames , this . localVariableModifiers , this . declaringTypeName , this . lineSeparator ) ; ICompilationUnit sourceUnit = new ICompilationUnit ( ) { public char [ ] getFileName ( ) { return CharOperation . concat ( className , Util . defaultJavaExtension ( ) . toCharArray ( ) ) ; } public char [ ] getContents ( ) { return mapper . getCUSource ( EvaluationContext . this . lineSeparator ) ; } public char [ ] getMainTypeName ( ) { return className ; } public char [ ] [ ] getPackageName ( ) { return null ; } } ; CompletionEngine engine = new CompletionEngine ( environment , mapper . getCompletionRequestor ( requestor ) , options , project ) ; <START_BUG> engine . complete ( sourceUnit , ( ( mapper . startPosOffset ) + completionPosition ) , 0 ) ; <END_BUG> } public void deleteVariable ( GlobalVariable variable ) { } private void deployCodeSnippetClassIfNeeded ( IRequestor requestor ) { } public void evaluate ( char [ ] codeSnippet , char [ ] [ ] contextLocalVariableTypeNames , char [ ] [ ] contextLocalVariableNames , int [ ] contextLocalVariableModifiers , char [ ] contextDeclaringTypeName , boolean contextIsStatic , boolean contextIsConstructorCall , INameEnvironment environment , Map options , final IRequestor requestor , IProblemFactory problemFactory ) throws InstallException { } public void evaluate ( char [ ] codeSnippet , INameEnvironment environment , Map options , final IRequestor requestor , IProblemFactory problemFactory ) throws InstallException { } public void evaluateImports ( INameEnvironment environment , IRequestor requestor , IProblemFactory problemFactory ) { } public void evaluateVariable ( GlobalVariable variable , INameEnvironment environment , Map options , IRequestor requestor , IProblemFactory problemFactory ) throws InstallException { } public void evaluateVariables ( INameEnvironment environment , Map options , IRequestor requestor , IProblemFactory problemFactory ) throws InstallException { } byte [ ] getCodeSnippetBytes ( ) { } public static String getCodeSnippetSource ( ) { } public char [ ] [ ] getImports ( ) { } public char [ ] getPackageName ( ) { } IBinaryType getRootCodeSnippetBinary ( ) { } public GlobalVariable newVariable ( char [ ] typeName , char [ ] name , char [ ] initializer ) { } public void select ( char [ ] codeSnippet , int selectionSourceStart , int selectionSourceEnd , SearchableEnvironment environment , ISelectionRequestor requestor , Map options ) { } public void setImports ( char [ ] [ ] imports ) { } public void setLineSeparator ( String lineSeparator ) { } public void setPackageName ( char [ ] packageName ) { } }

Fix:
engine . complete ( sourceUnit , ( ( mapper . startPosOffset ) + completionPosition ) , mapper . startPosOffset ) ;