while (r != null && result == null)
{
Iterator<ProjectCache> cacheIterator = caches.iterator();
while (cacheIterator.hasNext() && result == null)
{
ProjectCache cache = cacheIterator.next();
try
{
result = cache.get(r);
if (result != null && !filter.accept(result))
result = null;
if (result != null)
break;
}