if (JavaPlugin.USE_COMPLETION_REQUESTOR) unit.codeComplete(offset, (CompletionRequestor) collector); else unit.codeComplete(offset, (ICompletionRequestor) collector);
unit.codeComplete(offset, collector);
	private ICompletionProposal[] internalComputeCompletionProposals(ITextViewer viewer, int offset, int contextOffset) {				ICompilationUnit unit= fManager.getWorkingCopy(fEditor.getEditorInput());		ICompletionProposal[] results;		ResultCollector collector;		if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES)) {			collector= fExperimentalCollector;		} else {			collector= fCollector;		}					try {			if (unit != null) {				collector.setPreventEating(false);					collector.reset(offset, contextOffset, unit.getJavaProject(), fAllowAddImports ? unit : null);				collector.setViewer(viewer);								Point selection= viewer.getSelectedRange();				if (selection.y > 0)				collector.setReplacementLength(selection.y);								if (JavaPlugin.USE_COMPLETION_REQUESTOR)					unit.codeComplete(offset, (CompletionRequestor) collector);				else					unit.codeComplete(offset, (ICompletionRequestor) collector);			}		} catch (JavaModelException x) {			Shell shell= viewer.getTextWidget().getShell();			if (x.isDoesNotExist() && unit != null && !unit.getJavaProject().isOnClasspath(unit))				MessageDialog.openInformation(shell, JavaTextMessages.getString("CompletionProcessor.error.notOnBuildPath.title"), JavaTextMessages.getString("CompletionProcessor.error.notOnBuildPath.message"));  //$NON-NLS-1$//$NON-NLS-2$			else				ErrorDialog.openError(shell, JavaTextMessages.getString("CompletionProcessor.error.accessing.title"), JavaTextMessages.getString("CompletionProcessor.error.accessing.message"), x.getStatus()); //$NON-NLS-2$ //$NON-NLS-1$		}						results= collector.getResults();		if (fTemplateEngine != null) {			fTemplateEngine.reset();			fTemplateEngine.complete(viewer, offset, unit);										TemplateProposal[] templateResults= fTemplateEngine.getResults();						// update relevance of template proposals that match with a keyword			// give those templates slightly more relevance than the keyword to 			// sort them first			JavaCompletionProposal[] keyWordResults= collector.getKeywordCompletions();			for (int i= 0; i < keyWordResults.length; i++) {				String keyword= keyWordResults[i].getReplacementString();				for (int k= 0; k < templateResults.length; k++) {					TemplateProposal curr= templateResults[k];					if (curr.getTemplate().getName().startsWith(keyword)) {						curr.setRelevance(keyWordResults[i].getRelevance() + 1);					}				}			}				// concatenate arrays			ICompletionProposal[] total= new ICompletionProposal[results.length + templateResults.length];			System.arraycopy(templateResults, 0, total, 0, templateResults.length);			System.arraycopy(results, 0, total, templateResults.length, results.length);			results= total;		}				fNumberOfComputedResults= (results == null ? 0 : results.length);				/*		 * Order here and not in result collector to make sure that the order		 * applies to all proposals and not just those of the compilation unit. 		 */		return order(results);	}