Skip to content

Commit 90ae664

Browse files
committed
Remove double try
1 parent e5c4a9e commit 90ae664

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

src/test/java/io/reactivex/plugins/RxJavaPluginsTest.java

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,27 +1891,22 @@ public void accept(final Throwable throwable) throws Exception {
18911891

18921892
private static void verifyThread(Worker w, Predicate<Thread> threadPredicate) {
18931893
try {
1894-
try {
1895-
final AtomicReference<Thread> value = new AtomicReference<>();
1896-
final CountDownLatch cdl = new CountDownLatch(1);
1897-
1898-
w.schedule(new Runnable() {
1899-
@Override
1900-
public void run() {
1901-
value.set(Thread.currentThread());
1902-
cdl.countDown();
1903-
}
1904-
});
1894+
final AtomicReference<Thread> value = new AtomicReference<Thread>();
1895+
final CountDownLatch cdl = new CountDownLatch(1);
19051896

1906-
cdl.await();
1897+
w.schedule(new Runnable() {
1898+
@Override
1899+
public void run() {
1900+
value.set(Thread.currentThread());
1901+
cdl.countDown();
1902+
}
1903+
});
19071904

1908-
Thread t = value.get();
1909-
assertNotNull(t);
1910-
assertTrue(threadPredicate.test(t));
1905+
cdl.await();
19111906

1912-
} catch (Exception e) {
1913-
fail();
1914-
}
1907+
Thread t = value.get();
1908+
assertNotNull(t);
1909+
assertTrue(threadPredicate.test(t));
19151910
} catch (Exception e) {
19161911
fail();
19171912
} finally {

0 commit comments

Comments
 (0)