<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1413,22 +1413,26 @@ public final class MemcachedClient extends SpyThread {
 		}
 
 		public T get() throws InterruptedException, ExecutionException {
-			latch.await(globalOperationTimeout, TimeUnit.MILLISECONDS);
-			assert isDone() : &quot;Latch released, but operation wasn't done.&quot;;
-			if(op != null &amp;&amp; op.hasErrored()) {
-				throw new ExecutionException(op.getException());
-			}
-			if(isCancelled()) {
-				throw new ExecutionException(new RuntimeException(&quot;Cancelled&quot;));
+			try {
+				return get(globalOperationTimeout, TimeUnit.MILLISECONDS);
+			} catch (TimeoutException e) {
+				throw new RuntimeException(
+					&quot;Timed out waiting for operation&quot;, e);
 			}
-			return objRef.get();
 		}
 
 		public T get(long duration, TimeUnit units)
-			throws InterruptedException, TimeoutException {
+			throws InterruptedException, TimeoutException, ExecutionException {
 			if(!latch.await(duration, units)) {
 				throw new TimeoutException(&quot;Timed out waiting for operation&quot;);
 			}
+			if(op != null &amp;&amp; op.hasErrored()) {
+				throw new ExecutionException(op.getException());
+			}
+			if(isCancelled()) {
+				throw new ExecutionException(new RuntimeException(&quot;Cancelled&quot;));
+			}
+
 			return objRef.get();
 		}
 </diff>
      <filename>src/main/java/net/spy/memcached/MemcachedClient.java</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0be1844a79e2d9ecd635e770faf479f3a221be87</id>
    </parent>
  </parents>
  <author>
    <name>Dustin Sallings</name>
    <email>dustin@spy.net</email>
  </author>
  <url>http://github.com/dustin/java-memcached-client/commit/f1969bf1f88b62a71dcc9f392c4c9f0756fcea09</url>
  <id>f1969bf1f88b62a71dcc9f392c4c9f0756fcea09</id>
  <committed-date>2008-05-13T22:20:37-07:00</committed-date>
  <authored-date>2008-05-13T22:19:42-07:00</authored-date>
  <message>Some refactoring in the futures to get more consistent behavior.</message>
  <tree>8aafba90a32922014e8babb98c2af083de0fcd09</tree>
  <committer>
    <name>Dustin Sallings</name>
    <email>dustin@spy.net</email>
  </committer>
</commit>
