fix: fix and close #ICLQQ3

This commit is contained in:
Michael Yang 2025-07-14 12:48:51 +08:00
parent 97bf853364
commit cc2ca249e0

View File

@ -34,9 +34,11 @@ public class DataSourceKey {
public static void use(String dataSourceKey) {
Deque<String> deque = lookup.get();
if (deque != null) {
deque.push(dataSourceKey);
if (deque == null) {
deque = new ArrayDeque<>(1);
lookup.set(deque);
}
deque.push(dataSourceKey);
}
public static String get() {
@ -95,31 +97,4 @@ public class DataSourceKey {
return shardingDsKey != null ? shardingDsKey : dataSource;
}
// === For Removal ===
@Deprecated
public static String getByManual() {
throw new UnsupportedOperationException("使用 DataSource.get() 代替。");
}
@Deprecated
public static String getByAnnotation() {
throw new UnsupportedOperationException("使用 DataSource.get() 代替。");
}
@Deprecated
public static void useWithAnnotation(String dataSourceKey) {
throw new UnsupportedOperationException("使用 DataSource.use(String) 代替。");
}
@Deprecated
public static void setAnnotationKeyThreadLocal(ThreadLocal<String> annotationKeyThreadLocal) {
throw new UnsupportedOperationException("使用 DataSource.setThreadLocal(ThreadLocal<Deque<String>>) 代替。");
}
@Deprecated
public static void setManualKeyThreadLocal(ThreadLocal<String> manualKeyThreadLocal) {
throw new UnsupportedOperationException("使用 DataSource.setThreadLocal(ThreadLocal<Deque<String>>) 代替。");
}
}