Buggy code:
public class EvaluationContext implements EvaluationConstants { static final boolean TIMING = false ; static int VAR_CLASS_COUNTER = 0 ; static int CODE_SNIPPET_COUNTER = 0 ; GlobalVariable [ ] variables = new GlobalVariable [ 5 ] ; int variableCount = 0 ; char [ ] [ ] imports = new char [ 0 ] [ ] ; char [ ] packageName = new char [ 0 ] ; boolean varsChanged = true ; VariablesInfo installedVars ; IBinaryType codeSnippetBinary ; char [ ] declaringTypeName ; int [ ] localVariableModifiers ; char [ ] [ ] localVariableTypeNames ; char [ ] [ ] localVariableNames ; boolean isStatic = true ; boolean isConstructorCall = false ; public EvaluationContext ( ) { } public GlobalVariable [ ] allVariables ( ) { } public void complete ( char [ ] codeSnippet , int completionPosition , ISearchableNameEnvironment environment , ICompletionRequestor requestor , Map options ) { 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 ) ; ICompilationUnit sourceUnit = new ICompilationUnit ( ) { public char [ ] getFileName ( ) { return CharOperation . concat ( className , "java" . toCharArray ( ) , '.' ) ; } public char [ ] getContents ( ) { return mapper . getCUSource ( ) ; } public char [ ] getMainTypeName ( ) { return className ; } public char [ ] [ ] getPackageName ( ) { return null ; } } ; CompletionEngine engine = new CompletionEngine ( environment , mapper . getCompletionRequestor ( requestor ) , options ) ; <START_BUG> engine . complete ( sourceUnit , ( ( mapper . startPosOffset ) + completionPosition ) ) ; <END_BUG> } public void deleteVariable ( GlobalVariable variable ) { } private void deployCodeSnippetClassIfNeeded ( IRequestor requestor ) { } public void evaluate ( char [ ] codeSnippet , char [ ] [ ] localVariableTypeNames , char [ ] [ ] localVariableNames , int [ ] localVariableModifiers , char [ ] declaringTypeName , boolean isStatic , boolean isConstructorCall , 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 { } private byte [ ] getCodeSnippetBytes ( ) { } public static String getCodeSnippetSource ( ) { } public char [ ] [ ] getImports ( ) { } public char [ ] getPackageName ( ) { } IBinaryType getRootCodeSnippetBinary ( ) { } private String getSupportClassFileName ( String simpleName ) { } public GlobalVariable newVariable ( char [ ] typeName , char [ ] name , char [ ] initializer ) { } public void select ( char [ ] codeSnippet , int selectionSourceStart , int selectionSourceEnd , ISearchableNameEnvironment environment , ISelectionRequestor requestor , Map options ) { } public void setImports ( char [ ] [ ] imports ) { } public void setPackageName ( char [ ] packageName ) { } }

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