for (Contribution c: workspace.getContributions()) {
URI uri = URI.create(c.getURI());
URL location = locationURL(c.getLocation());
// Get contribution from cache
ContributionCache contributionCache = cache.contributions.get(location);
long lastModified = lastModified(location);
if (contributionCache != null) {
if (contributionCache.contributionLastModified == lastModified) {
Contribution contribution = contributionCache.contribution;
contribution.setUnresolved(false);
contributions.getContributions().add(contribution);
continue;
}
// Reset contribution cache
cache.contributions.remove(location);
}
try {
Contribution contribution = (Contribution)contributionProcessor.read(null, uri, location);
contribution.setUnresolved(false);
contributions.getContributions().add(contribution);
// Cache contribution
contributionCache = new ContributionCache();
contributionCache.contribution = contribution;
contributionCache.contributionLastModified = lastModified;
cache.contributions.put(location, contributionCache);