Buggy code:
public class XQDTCompletionEngine extends ScriptCompletionEngine { protected XQDTAssistParser fParser ; protected ISourceModule fSourceModule ; protected int fLanguageLevel ; protected String fPrefix ; protected XQDTCompletionEngine . CompletionPrefixType fPrefixType = XQDTCompletionEngine . CompletionPrefixType . NORMAL ; public static enum CompletionPrefixType { NORMAL , DOLLAR , COLON , AMPERSAND ; } public static final int RELEVANCE_KEYWORD = 100000 ; public static final int RELEVANCE_TEMPLATE = 1000000 ; public static final int RELEVANCE_FUNCTIONS = 10000000 ; public static final int RELEVANCE_VARIABLES = 100000000 ; protected int getEndOfEmptyToken ( ) { } protected String processFieldName ( IField field , String token ) { } protected String processMethodName ( IMethod method , String token ) { } protected String processTypeName ( IType method , String token ) { } public IAssistParser getParser ( ) { } public void complete ( org . eclipse . dltk . compiler . env . ISourceModule sourceModule , int completionPosition , int pos ) { } protected int getLanguageLevel ( ISourceModule module ) { } private void reportKeywords ( ) { } private void reportKeyword ( String name ) { } private void reportFunctions ( ) { } private void reportDeclaredFunctions ( ) { } private void reportImportedFunctions ( ) { } private void reportVendorImplicitImportedFunctions ( ) { } private void reportBuiltinFunctions ( String namespacePrefix , IPath builtinModulePath ) { } private void reportEntities ( ) { } private void reportEntity ( String name , String character ) { } protected URI getBaseUri ( ) { } private List < ISourceModule > resolveImports ( URI baseUri , List < XQueryModuleImport > importedModules ) { } protected IUriResolver getModuleResolver ( ) { } @ SuppressWarnings ( "unchecked" ) private void buildFunctionCompletions ( MethodDeclaration [ ] decls , String prefix ) { if ( decls == null ) { return ; } for ( int i = 0 ; i < ( decls . length ) ; i ++ ) { MethodDeclaration decl = decls [ i ] ; String name = decl . getName ( ) ; if ( prefix != null ) { name = ( prefix + ":" ) + ( name . substring ( ( ( name . indexOf ( ':' ) ) + 1 ) ) ) ; } if ( ( name . startsWith ( fPrefix ) ) || ( name . substring ( ( ( name . indexOf ( ':' ) ) + 1 ) ) . startsWith ( fPrefix ) ) ) { CompletionProposal proposal = createProposal ( METHOD_REF , actualCompletionPosition ) ; proposal . setName ( name . toCharArray ( ) ) ; proposal . setCompletion ( name . toCharArray ( ) ) ; List args = decl . getArguments ( ) ; char [ ] [ ] parameterNames = new char [ args . size ( ) ] [ ] ; for ( int j = 0 ; j < ( args . size ( ) ) ; ++ j ) { Argument arg = ( ( Argument ) ( args . get ( j ) ) ) ; <START_BUG> parameterNames [ j ] = arg . getName ( ) . toCharArray ( ) ; <END_BUG> } proposal . setParameterNames ( parameterNames ) ; proposal . setReplaceRange ( ( ( this . startPosition ) - ( this . offset ) ) , ( ( this . endPosition ) - ( this . offset ) ) ) ; proposal . setRelevance ( XQDTCompletionEngine . RELEVANCE_FUNCTIONS ) ; requestor . accept ( proposal ) ; noProposal = false ; } } } protected String extractPrefix ( int offset ) { } private String extractWord ( char [ ] content , int offset , XQDTWordDetector wd , boolean checkPrefixPrefix ) { } }

Fix:
parameterNames [ j ] = ( "$" + ( arg . getName ( ) ) ) . toCharArray ( ) ;