You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2025/05/15 01:48:26 UTC
(shardingsphere) branch revert-35411-dev created (now a2934e395cc)
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a change to branch revert-35411-dev
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
at a2934e395cc Revert "Replace ThreadLocalRandom with SecureRandom for better security (#35411)"
This branch includes the following new commits:
new a2934e395cc Revert "Replace ThreadLocalRandom with SecureRandom for better security (#35411)"
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(shardingsphere) 01/01: Revert "Replace ThreadLocalRandom with SecureRandom for better security (#35411)"
Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch revert-35411-dev
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
commit a2934e395ccb8c1584e6236cbcbc45014efa4cd0
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Thu May 15 09:48:18 2025 +0800
Revert "Replace ThreadLocalRandom with SecureRandom for better security (#35411)"
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()));
}
}