Buggy code:
public class AnnotationCompletionProposalComputer implements IJavaCompletionProposalComputer { public AnnotationCompletionProposalComputer ( ) { } @ SuppressWarnings ( "unchecked" ) public List computeCompletionProposals ( ContentAssistInvocationContext context , IProgressMonitor monitor ) { } @ SuppressWarnings ( "unchecked" ) private List < ICompletionProposal > computeCompletionProposals ( JavaContentAssistInvocationContext context ) { CompletionContext completionContext = context . getCoreContext ( ) ; <START_BUG> int tokenStart = completionContext . getTokenStart ( ) ; <END_BUG> ICompilationUnit source = context . getCompilationUnit ( ) ; try { IJavaElement javaElement = source . getElementAt ( tokenStart ) ; if ( javaElement != null ) { CompilationUnit compilationUnit = JDTUtils . getCompilationUnit ( source ) ; int elementType = javaElement . getElementType ( ) ; if ( elementType == ( IJavaElement . PACKAGE_DECLARATION ) ) { PackageDeclaration packageDeclaration = compilationUnit . getPackage ( ) ; List < Annotation > packageAnnotations = packageDeclaration . annotations ( ) ; for ( Annotation annotation : packageAnnotations ) { if ( annotation instanceof NormalAnnotation ) { NormalAnnotation normalAnnotation = ( ( NormalAnnotation ) ( annotation ) ) ; MemberValuePair memberValuePair = getMemberValuePairForPosition ( normalAnnotation , tokenStart ) ; if ( memberValuePair != null ) { return getCompletionProposalsForASTNode ( normalAnnotation , memberValuePair , packageDeclaration ) ; } } } } if ( ( elementType == ( IJavaElement . TYPE ) ) || ( elementType == ( IJavaElement . FIELD ) ) ) { return getCompletionProposalsForJavaElement ( AnnotationUtils . getExtendedModifiers ( compilationUnit , javaElement ) , javaElement , tokenStart ) ; } if ( elementType == ( IJavaElement . METHOD ) ) { SingleVariableDeclaration parameter = AnnotationUtils . getMethodParameter ( compilationUnit , ( ( IMethod ) ( javaElement ) ) , tokenStart ) ; if ( parameter != null ) { return getCompletionProposalsForASTNode ( parameter . modifiers ( ) , parameter , tokenStart ) ; } else { return getCompletionProposalsForJavaElement ( AnnotationUtils . getExtendedModifiers ( compilationUnit , javaElement ) , javaElement , tokenStart ) ; } } } } catch ( JavaModelException jme ) { JAXWSUIPlugin . log ( jme . getStatus ( ) ) ; } return Collections . emptyList ( ) ; } private List < ICompletionProposal > getCompletionProposalsForASTNode ( List < IExtendedModifier > modifiers , ASTNode astNode , int offset ) { } private List < ICompletionProposal > getCompletionProposalsForJavaElement ( List < IExtendedModifier > modifiers , IJavaElement javaElement , int offset ) { } private List < ICompletionProposal > getCompletionProposalsForASTNode ( NormalAnnotation normalAnnotation , MemberValuePair memberValuePair , ASTNode astNode ) { } private List < ICompletionProposal > getCompletionProposalsForJavaElement ( NormalAnnotation normalAnnotation , MemberValuePair memberValuePair , IJavaElement javaElement ) { } @ SuppressWarnings ( "unchecked" ) private MemberValuePair getMemberValuePairForPosition ( NormalAnnotation normalAnnotation , int offset ) { } @ SuppressWarnings ( "unchecked" ) public List computeContextInformation ( ContentAssistInvocationContext context , IProgressMonitor monitor ) { } public String getErrorMessage ( ) { } public void sessionEnded ( ) { } public void sessionStarted ( ) { } }

Fix:
int tokenStart = completionContext . getOffset ( ) ;