@Override public final <T> Lookup.Result<T> lookup(Lookup.Template<T> template) { beforeLookupResult(template); for (;;) { AbstractLookup.ISE toRun = null; AbstractLookup.Storage<?> t = enterStorage(); try { R<T> r = new R<T>(); ReferenceToResult<T> newRef = new ReferenceToResult<T>(r, this, template); newRef.next = t.registerReferenceToResult(newRef); return r; } catch (AbstractLookup.ISE ex) { toRun = ex; } finally { exitStorage(); } toRun.recover(this); // and try again } }
@Override public final <T> Lookup.Result<T> lookup(Lookup.Template<T> template) { beforeLookupResult(template); for (;;) { AbstractLookup.ISE toRun = null; AbstractLookup.Storage<?> t = enterStorage(); try { R<T> r = new R<T>(); ReferenceToResult<T> newRef = new ReferenceToResult<T>(r, this, template); newRef.next = t.registerReferenceToResult(newRef); return r; } catch (AbstractLookup.ISE ex) { toRun = ex; } finally { exitStorage(); } toRun.recover(this); // and try again } }