[pull] v5-master from chinabugotech:v5-master#27
Open
pull[bot] wants to merge 587 commits into
Open
Conversation
fix(dfa): 修复WordTree.addWord在关键词以停顿词结尾时词尾标记错误的问题
为兼容 JDK 24 及以上版本中ServiceLoader#iterator 可能抛出 NoClassDefFoundError 的情况,优化 loadFirstAvailable 方法,统一在 hasNext 与 next 调用时安全忽略异常,确保能正确返回首个可用的非空实例。 Closes https://gitee.com/chinabugotech/hutool/issues/ID0952
fix(core): 由于 JDK 24+ 修改,优化 ServiceLoader 加载第一个可用服务的逻辑
Signed-off-by: chinabugotech <bugo@bugotech.cn>
增加zip函数,可以将两个列表中的元素一一配对并返回一个新的结果列表
…ate 的问题 使用 get + putIfAbsent 替代 computeIfAbsent,避免 ConcurrentHashMap 在递归场景下 抛出 Recursive update 异常。修复 issue#IDQYJK
在 AbstractCache.get(key, isUpdateLastAccess, timeout, supplier) 方法中, 双重检查获取到缓存值后,未对结果进行 null 判断就直接调用 supplier 并覆盖, 导致高并发场景下出现不必要的 supplier 调用和潜在的数据不一致。 修复:在双重检查后增加 null 判断,仅当缓存确实为空时才调用 supplier。 Fixes #IDQGP2
Tuple 设计为不可变类型(注释:不可变数组类型),但原实现存在两处不可变性破坏: 1. 构造函数直接赋值 `this.members = members`,外部修改传入数组会影响 Tuple 内部状态 2. `getMembers()` 直接返回内部数组引用,外部可通过引用直接修改 Tuple 内容 修复:在构造函数中对传入数组做 defensive copy,getMembers() 返回副本
新增 SelfRefEnum 枚举和 getFieldValuesRecursiveTest 测试方法, 验证 fix issue#IDQYJK(修复枚举类静态初始化中调用 EnumUtil 导致 Recursive update 的问题)
…符及 null 检查 工具类中该方法遗漏了 static 关键字,导致无法以工具类方式调用(需要先实例化 TemporalUtil)。 同时与同类的 offset(T, long, TemporalUnit) 方法保持一致,增加 null 检查, 避免传入 null 时抛出 NullPointerException。
当 src 或 dest 为 null 时,提前抛出明确的 NullPointerException, 而非让 System.arraycopy 抛出不直观的异常,便于调用方定位问题。
当除数 val 为 0 时,Math.round(cent / 0.0) 会得到 Long.MAX_VALUE 分(约 9.2 * 10^16 元), 而不是抛出异常,导致计算结果错误且无任何提示。 增加显式的除零检查,在 val == 0 时抛出 ArithmeticException。
…ption 的问题 当使用 capacity=0 构造 BoundedPriorityQueue 时,offer() 中 size()>=capacity 始终为 true, 调用 peek() 返回 null,然后 comparator.compare(e, null) 抛出 NullPointerException。 修复: 1. 构造函数中对 capacity<=0 做保护(初始容量最小为1,避免 PriorityQueue 内部异常) 2. offer() 中增加 capacity<=0 的提前返回,不接受任何元素
原代码:`j = (j + sbox[i] + (key[i % key.length]) & 0xFF) % SBOX_LENGTH` 由于 Java 中 `&` 的优先级低于 `+`,实际计算等同于: `j = ((j + sbox[i] + key[i % key.length]) & 0xFF) % 256` 而标准 RC4 算法要求先将 byte 转为无符号整数再参与加法: `j = (j + sbox[i] + (key[i % key.length] & 0xFF)) % SBOX_LENGTH` 当 key 中含有非 ASCII 字符(如中文,UTF-8 编码后可能产生负 byte 值)时, 原实现的 sbox 初始化结果与标准 RC4 不一致,导致加密结果错误。
Merge pull request !1432 from Busyliu/v5-dev
修复`CharSequenceUtil.center`两个重载方法的注释问题
Merge pull request !1433 from 07heco/perf/reflectutil-method-cache
89e773c to
34bebfd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )