public boolean execute(IProgressMonitor progressMonitor) {
if (this.isCancelled || progressMonitor != null && progressMonitor.isCanceled()) return true;
if (!this.folder.isAccessible()) return true; // nothing to do
Index index = this.manager.getIndexForUpdate(this.containerPath, true, /*reuse index file*/ true /*create if none*/);
if (index == null) return true;
ReadWriteMonitor monitor = index.monitor;
if (monitor == null) return true; // index got deleted since acquired
try {
monitor.enterRead(); // ask permission to read
String[] paths = index.queryDocumentNames(""); // all file names //$NON-NLS-1$
int max = paths == null ? 0 : paths.length;
final SimpleLookupTable indexedFileNames = new SimpleLookupTable(max==0 ? 33 : max+11);
final String OK = "OK"; //$NON-NLS-1$
final String DELETED = "DELETED"; //$NON-NLS-1$
if (paths == null) {
this.folder.accept(new IResourceProxyVisitor() {
public boolean visit(IResourceProxy proxy) {
if (IndexBinaryFolder.this.isCancelled) return false;
if (proxy.getType() == IResource.FILE) {
if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(proxy.getName())) {
IFile file = (IFile) proxy.requestResource();
String containerRelativePath = Util.relativePath(file.getFullPath(), IndexBinaryFolder.this.containerPath.segmentCount());
indexedFileNames.put(containerRelativePath, file);
}
return false;
}
return true;
}
}, IResource.NONE);
} else {
for (int i = 0; i < max; i++) {
indexedFileNames.put(paths[i], DELETED);
}
final long indexLastModified = index.getIndexLastModified();
this.folder.accept(
new IResourceProxyVisitor() {
public boolean visit(IResourceProxy proxy) throws CoreException {
if (IndexBinaryFolder.this.isCancelled) return false;
if (proxy.getType() == IResource.FILE) {