System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
protected IJavaElement[] codeSelect(org.eclipse.jdt.internal.compiler.env.ICompilationUnit cu, int offset, int length, WorkingCopyOwner owner) throws JavaModelException {
PerformanceStats performanceStats = SelectionEngine.PERF
? PerformanceStats.getStats(JavaModelManager.SELECTION_PERF, this)
: null;
if(performanceStats != null) {
performanceStats.startRun(new String(cu.getFileName()) + " at [" + offset + "," + length + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
JavaProject project = (JavaProject)getJavaProject();
SearchableEnvironment environment = project.newSearchableNameEnvironment(owner);
SelectionRequestor requestor= new SelectionRequestor(environment.nameLookup, this);
IBuffer buffer = getBuffer();
if (buffer == null) {
return requestor.getElements();
}
int end= buffer.getLength();
if (offset < 0 || length < 0 || offset + length > end ) {
throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INDEX_OUT_OF_BOUNDS));
}
// fix for 1FVXGDK
SelectionEngine engine = new SelectionEngine(environment, requestor, project.getOptions(true), owner);
engine.select(cu, offset, offset + length - 1);
if(performanceStats != null) {
performanceStats.endRun();
}
if (NameLookup.VERBOSE) {
System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInSourcePackage: " + environment.nameLookup.timeSpentInSeekTypesInSourcePackage + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println(Thread.currentThread() + " TIME SPENT in NameLoopkup#seekTypesInBinaryPackage: " + environment.nameLookup.timeSpentInSeekTypesInBinaryPackage + "ms"); //$NON-NLS-1$ //$NON-NLS-2$
}