(Object key)
| 403 | } |
| 404 | |
| 405 | @SuppressWarnings("unchecked") // unsafe, which is one advantage of Cache over Map |
| 406 | @Override |
| 407 | public V get(Object key) { |
| 408 | V value; |
| 409 | try { |
| 410 | value = getOrCompute((K) key); |
| 411 | } catch (ExecutionException e) { |
| 412 | Throwable cause = e.getCause(); |
| 413 | Throwables.propagateIfInstanceOf(cause, ComputationException.class); |
| 414 | throw new ComputationException(cause); |
| 415 | } |
| 416 | if (value == null) { |
| 417 | throw new NullPointerException(computingFunction + " returned null for key " + key + "."); |
| 418 | } |
| 419 | return value; |
| 420 | } |
| 421 | } |
| 422 | } |
nothing calls this directly
no test coverage detected