mirror of
https://gitee.com/dromara/hutool.git
synced 2026-02-09 09:16:26 +08:00
修复ServiceLoaderUtil.loadFirstAvailable在JDK24+后未捕获异常导致的报错问题(pr#4098@Github)
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
* 【ai 】 修复`AIConfigBuilder`中方法名拼写错误(pr#1382@Gitee)
|
||||
* 【core 】 修复`StrBuilder`charAt越界判断错误(pr#4094@Github)
|
||||
* 【dfa 】 修复`WordTree.addWord`末尾为特殊字符导致的无法匹配问题(pr#4092@Github)
|
||||
* 【core 】 修复`ServiceLoaderUtil.loadFirstAvailable`在JDK24+后未捕获异常导致的报错问题(issue#ID0952@Gitee)
|
||||
* 【core 】 修复`ServiceLoaderUtil.loadFirstAvailable`在JDK24+后未捕获异常导致的报错问题(pr#4098@Github)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
# 5.8.40(2025-08-26)
|
||||
|
||||
@@ -37,8 +37,7 @@ public class ServiceLoaderUtil {
|
||||
* @see <a href="https://bugs.openjdk.org/browse/JDK-8350481">JDK-8350481</a>
|
||||
*/
|
||||
public static <T> T loadFirstAvailable(Class<T> clazz) {
|
||||
final ServiceLoader<T> loader = ServiceLoader.load(clazz);
|
||||
final Iterator<T> iterator = loader.iterator();
|
||||
final Iterator<T> iterator = load(clazz).iterator();
|
||||
while (true) {
|
||||
T instance;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user