CompletionProposalCollector collector; if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES)) { collector= new ExperimentalResultCollector(unit); } else { collector= new CompletionProposalCollector(unit); }
CompletionProposalCollector collector= createCollector(unit);
	private List internalComputeCompletionProposals(int offset, JavaContentAssistInvocationContext context, IProgressMonitor monitor) {		ICompilationUnit unit= context.computeCompilationUnit();		if (unit == null)			return Collections.EMPTY_LIST;				ITextViewer viewer= context.getViewer();				CompletionProposalCollector collector;		if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES)) {			collector= new ExperimentalResultCollector(unit);		} else {			collector= new CompletionProposalCollector(unit);		}				context.setCollector(collector);		try {			Point selection= viewer.getSelectedRange();			if (selection.y > 0)				collector.setReplacementLength(selection.y);							unit.codeComplete(offset, collector);		} catch (JavaModelException x) {			Shell shell= viewer.getTextWidget().getShell();			if (x.isDoesNotExist() && !unit.getJavaProject().isOnClasspath(unit))				MessageDialog.openInformation(shell, JavaTextMessages.CompletionProcessor_error_notOnBuildPath_title, JavaTextMessages.CompletionProcessor_error_notOnBuildPath_message);			else				ErrorDialog.openError(shell, JavaTextMessages.CompletionProcessor_error_accessing_title, JavaTextMessages.CompletionProcessor_error_accessing_message, x.getStatus());		}		ICompletionProposal[] javaProposals= collector.getJavaCompletionProposals();		int contextInformationOffset= guessContextInformationPosition(context);		if (contextInformationOffset != offset) {			for (int i= 0; i < javaProposals.length; i++) {				if (javaProposals[i] instanceof JavaMethodCompletionProposal) {					JavaMethodCompletionProposal jmcp= (JavaMethodCompletionProposal) javaProposals[i];					jmcp.setContextInformationPosition(contextInformationOffset);				}			}		}				List proposals= new ArrayList(Arrays.asList(javaProposals));		return proposals;	}