title: In JCIP sample "Listing 5.19 Memoizer", the cache should be removed when ExecutionException happen
body: <p>Many people read "Java Concurrency in Practice", but paste the code in here for convenience.</p>
  
  <p><strong>5.19 Final implementation of Memoizer</strong>:</p>
  
  <pre><code>public class Memoizer&lt;A, V&gt; implements Computable&lt;A, V&gt; {
      private final ConcurrentMap&lt;A, Future&lt;V&gt;&gt; cache = new ConcurrentHashMap&lt;A, Future&lt;V&gt;&gt;();
      private final Computable&lt;A, V&gt; c;
  
      public Memoizer(Computable&lt;A, V&gt; c) {
          this.c = c;
      }
  
      public V compute(final A arg) throws InterruptedException {
          while (true) {
              Future&lt;V&gt; f = cache.get(arg);
              if (f == null) {
                  Callable&lt;V&gt; eval = new Callable&lt;V&gt;() {
                      public V call() throws InterruptedException {
                          return c.compute(arg);
                      }
                  };
                  FutureTask&lt;V&gt; ft = new FutureTask&lt;V&gt;(eval);
                  f = cache.putIfAbsent(arg, ft);
                  if (f == null) {
                      f = ft;
                      ft.run();
                  }
              }
              try {
                  return f.get();
              } catch (CancellationException e) {
                  cache.remove(arg, f);
              } catch (ExecutionException e) {
                  throw LaunderThrowable.launderThrowable(e.getCause());
              }
          }
      }
  }
  </code></pre>
  
  <p>My problem is in catch (ExecutionException e), the following snippet should be added:</p>
  
  <pre><code>cache.remove(arg, f);
  </code></pre>
  
  <p>Correct?</p>