From 80d5395a29880443419d35c127ed7c480d716e3d Mon Sep 17 00:00:00 2001 From: Shikhar Bhushan Date: Tue, 2 Mar 2010 00:07:00 +0100 Subject: [PATCH] reformat --- src/main/java/net/schmizz/concurrent/Event.java | 11 +++++++---- src/main/java/net/schmizz/concurrent/Future.java | 6 ++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/schmizz/concurrent/Event.java b/src/main/java/net/schmizz/concurrent/Event.java index a3f00510..55913ca5 100644 --- a/src/main/java/net/schmizz/concurrent/Event.java +++ b/src/main/java/net/schmizz/concurrent/Event.java @@ -31,7 +31,8 @@ import java.util.concurrent.locks.ReentrantLock; * * @see Future */ -public class Event extends Future { +public class Event + extends Future { /** * Creates this event with given {@code name} and exception {@code chainer}. Allocates a new {@link @@ -65,7 +66,8 @@ public class Event extends Future { * * @throws T if another thread meanwhile informs this event of an error */ - public void await() throws T { + public void await() + throws T { super.get(); } @@ -73,11 +75,12 @@ public class Event extends Future { * Await this event to have a definite {@code true} or {@code false} value, for {@code timeout} seconds. * * @param timeout timeout in seconds - * @param unit + * @param unit the time unit * * @throws T if another thread meanwhile informs this event of an error, or timeout expires */ - public void await(long timeout, TimeUnit unit) throws T { + public void await(long timeout, TimeUnit unit) + throws T { super.get(timeout, unit); } diff --git a/src/main/java/net/schmizz/concurrent/Future.java b/src/main/java/net/schmizz/concurrent/Future.java index 3148de5d..5e3204b9 100644 --- a/src/main/java/net/schmizz/concurrent/Future.java +++ b/src/main/java/net/schmizz/concurrent/Future.java @@ -116,7 +116,8 @@ public class Future { * * @throws T in case another thread informs the future of an error meanwhile */ - public V get() throws T { + public V get() + throws T { return get(0, TimeUnit.SECONDS); } @@ -130,7 +131,8 @@ public class Future { * * @throws T in case another thread informs the future of an error meanwhile, or the timeout expires */ - public V get(long timeout, TimeUnit unit) throws T { + public V get(long timeout, TimeUnit unit) + throws T { lock(); try { if (pendingEx != null)