}
	public static TypeInfo[] getAllTypes(IProgressMonitor monitor) {		if (monitor == null)			monitor= new NullProgressMonitor();		monitor.beginTask("", 10); //$NON-NLS-1$		SubProgressMonitor checkingMonitor= new SubProgressMonitor(monitor, 1);		SubProgressMonitor searchingMonitor= new SubProgressMonitor(monitor, 9);		forceDeltaComplete(checkingMonitor);		searchingMonitor.setTaskName(CorextMessages.getString("AllTypesCache.searching")); //$NON-NLS-1$				synchronized(fgLock) {			try {				if (fgTypeCache == null) {					// cache is empty										if (fgTypeCacherThread == null) {						// cache synchroneously						ArrayList searchResult= new ArrayList(fgSizeHint);						try {							fgIsLocked= true;							if (search(new TypeInfoRequestor(searchResult), IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, searchingMonitor)) {								TypeInfo[] result= (TypeInfo[]) searchResult.toArray(new TypeInfo[searchResult.size()]);								Arrays.sort(result, fgTypeNameComparator);								fgTypeCache= result;								fgSizeHint= result.length;							}						} finally {							fgIsLocked= false;						}						} else {					    						    // update searchingMonitor with data from XxxProgressMonitor					    searchingMonitor.beginTask(fCountingProgressMonitor.fTaskName, fCountingProgressMonitor.fTotalWork);					    double lastWorked= fCountingProgressMonitor.getWorked();					    searchingMonitor.internalWorked(lastWorked);					    				    						// wait for the thread to finished						try {							while (fgTypeCache == null) {								fgLock.wait(CANCEL_POLL_INTERVAL);	// poll for cancel and ProgressMonitor updates								if (searchingMonitor.isCanceled()) {								    fCountingProgressMonitor.setCanceled(true);									throw new OperationCanceledException();								}								double currentWorked= fCountingProgressMonitor.getWorked();								int newDelta= (int) (currentWorked - lastWorked);								if (newDelta > 0)								    searchingMonitor.worked(newDelta);								lastWorked= currentWorked;							}						} catch (InterruptedException e) {							JavaPlugin.log(e);						} finally {						    searchingMonitor.done();						}					}				}							} finally {				monitor.done();			}			return fgTypeCache;		}	}