{
SchemaResource resource = (SchemaResource)i.next();
seenCacheEntries.add(resource._cacheEntry);
}
DownloadedSchemas downloadedSchemas = _importsDoc.getDownloadedSchemas();
for (int i = 0; i < downloadedSchemas.sizeOfEntryArray(); i++)
{
DownloadedSchemaEntry cacheEntry = downloadedSchemas.getEntryArray(i);
if (seenCacheEntries.contains(cacheEntry) == setToDelete)
{
SchemaResource resource = (SchemaResource)_resourceForCacheEntry.get(cacheEntry);
warning("Removing obsolete cache entry for " + resource.getFilename());
if (resource != null)
{
_resourceForCacheEntry.remove(cacheEntry);
if (resource == _resourceForFilename.get(resource.getFilename()))
_resourceForFilename.remove(resource.getFilename());
if (resource == _resourceForDigest.get(resource.getSha1()))
_resourceForDigest.remove(resource.getSha1());
if (resource == _resourceForNamespace.get(resource.getNamespace()))
_resourceForNamespace.remove(resource.getNamespace());
// Finally, any or all URIs
String[] urls = resource.getSchemaLocationArray();
for (int j = 0; j < urls.length; j++)
{
if (resource == _resourceForURL.get(urls[j]))
_resourceForURL.remove(urls[j]);
}
}
downloadedSchemas.removeEntry(i);
i -= 1;
}
}
}