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