Skip to content

Commit

Permalink
Remove double try
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Jan 25, 2017
1 parent e5c4a9e commit 90ae664
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions src/test/java/io/reactivex/plugins/RxJavaPluginsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1891,27 +1891,22 @@ public void accept(final Throwable throwable) throws Exception {

private static void verifyThread(Worker w, Predicate<Thread> threadPredicate) {
try {
try {
final AtomicReference<Thread> value = new AtomicReference<>();
final CountDownLatch cdl = new CountDownLatch(1);

w.schedule(new Runnable() {
@Override
public void run() {
value.set(Thread.currentThread());
cdl.countDown();
}
});
final AtomicReference<Thread> value = new AtomicReference<Thread>();
final CountDownLatch cdl = new CountDownLatch(1);

cdl.await();
w.schedule(new Runnable() {
@Override
public void run() {
value.set(Thread.currentThread());
cdl.countDown();
}
});

Thread t = value.get();
assertNotNull(t);
assertTrue(threadPredicate.test(t));
cdl.await();

} catch (Exception e) {
fail();
}
Thread t = value.get();
assertNotNull(t);
assertTrue(threadPredicate.test(t));
} catch (Exception e) {
fail();
} finally {
Expand Down

0 comments on commit 90ae664

Please sign in to comment.