Skip to content

Commit 8d31af9

Browse files
committed
fixed build using older JDK API
1 parent 83477b6 commit 8d31af9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clickhouse-jdbc/src/test/java/com/clickhouse/jdbc/ClickHouseStatementTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import java.util.concurrent.ScheduledExecutorService;
3737
import java.util.concurrent.TimeUnit;
3838
import java.util.concurrent.atomic.AtomicBoolean;
39+
import java.util.concurrent.atomic.AtomicReference;
3940

4041
import com.clickhouse.client.ClickHouseClient;
4142
import com.clickhouse.client.ClickHouseException;
@@ -1409,13 +1410,13 @@ public void testMultiThreadedExecution() throws Exception {
14091410

14101411
ScheduledExecutorService executor = Executors.newScheduledThreadPool(3);
14111412

1412-
final WeakReference<Exception> failedException = new WeakReference<>(null);
1413+
final AtomicReference<Exception> failedException = new AtomicReference<>(null);
14131414
for (int i = 0; i < 3; i++) {
14141415
executor.scheduleWithFixedDelay(() -> {
14151416
try {
14161417
stmt.execute("select 1");
14171418
} catch (Exception e) {
1418-
failedException.refersTo(e);
1419+
failedException.set(e);
14191420
}
14201421
}, 100, 100, TimeUnit.MILLISECONDS);
14211422
}

0 commit comments

Comments
 (0)