Guava ExecutionError - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava ExecutionError class.

This code example shows how to use the following methods:getCause
 
    try { 
      cache.getUnchecked(new Object()); 
      fail();
    } catch (ExecutionError expected) {
      assertEquals(cause, expected.getCause());
    } 
 
    Object newValue = new Object(); 
    valueRef.set(newValue); 
    assertSame(newValue, cache.getUnchecked(new Object()));
  } 
 
  public void testGetUnchecked_otherThrowable() { 
    final Throwable cause = new Throwable();
    final AtomicReference<Object> valueRef = new AtomicReference<Object>();
    LoadingCache<Object, Object> cache = new AbstractLoadingCache<Object, Object>() {
      @Override 
      public Object get(Object key) throws ExecutionException { 
        Object v = valueRef.get(); 
4
CodeRank