This is an automated email from the ASF dual-hosted git repository. zhangliang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push: new 07209678b80 Revert "Replace ThreadLocalRandom with SecureRandom for better security (#35411)" (#35414) 07209678b80 is described below commit 07209678b80a7e7bc36140586813a750cbfb2f99 Author: Liang Zhang <zhangli...@apache.org> AuthorDate: Thu May 15 09:51:29 2025 +0800 Revert "Replace ThreadLocalRandom with SecureRandom for better security (#35411)" (#35414) This reverts commit 8f5b7a8d12551f2cacf22a6c5279707f3fe07996. --- .../tableless/type/unicast/TablelessDataSourceUnicastRouteEngine.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infra/route/src/main/java/org/apache/shardingsphere/infra/route/engine/tableless/type/unicast/TablelessDataSourceUnicastRouteEngine.java b/infra/route/src/main/java/org/apache/shardingsphere/infra/route/engine/tableless/type/unicast/TablelessDataSourceUnicastRouteEngine.java index 4cfb39e3695..09cf89cdd9d 100644 --- a/infra/route/src/main/java/org/apache/shardingsphere/infra/route/engine/tableless/type/unicast/TablelessDataSourceUnicastRouteEngine.java +++ b/infra/route/src/main/java/org/apache/shardingsphere/infra/route/engine/tableless/type/unicast/TablelessDataSourceUnicastRouteEngine.java @@ -24,10 +24,10 @@ import org.apache.shardingsphere.infra.route.context.RouteMapper; import org.apache.shardingsphere.infra.route.context.RouteUnit; import org.apache.shardingsphere.infra.route.engine.tableless.TablelessRouteEngine; -import java.security.SecureRandom; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.concurrent.ThreadLocalRandom; /** * Tableless datasource unicast route engine. @@ -48,6 +48,6 @@ public final class TablelessDataSourceUnicastRouteEngine implements TablelessRou } private String getRandomDataSourceName(final Collection<String> dataSourceNames) { - return new ArrayList<>(dataSourceNames).get(new SecureRandom().nextInt(dataSourceNames.size())); + return new ArrayList<>(dataSourceNames).get(ThreadLocalRandom.current().nextInt(dataSourceNames.size())); } }