mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2026-05-29 18:57:11 +08:00
修复EnumUtil和AbstractCache的bug
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
# 🚀Changelog
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
# 5.8.44(2026-02-09)
|
||||
# 5.8.44(2026-03-02)
|
||||
### 🐣新特性
|
||||
* 【core 】 `NumberUtil.parseNumber`增加支持科学计数法(pr#4211@Github)
|
||||
* 【captcha】 `AbstractCaptcha`增加`setStroke`方法支持线条粗细(issue#IDJQ15@Gitee)
|
||||
@@ -19,6 +19,8 @@
|
||||
* 【core 】 修复`JschSessionPool`回收导致的session未关闭问题(issue#4223@Github)
|
||||
* 【core 】 修复`XmlUtil.xmlToBean`option参数无效问题(issue#4226@Github)
|
||||
* 【core 】 修复`ReUtil.replaceAll`空指针问题(issue#IDPHVW@Gitee)
|
||||
* 【core 】 修复`EnumUtil`枚举类静态初始化时触发 Recursive update 异常(pr#1432@Gitee)
|
||||
* 【core 】 修复`AbstractCache`高并发下 get+supplier 双重检查锁逻辑缺陷(pr#1432@Gitee)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
# 5.8.43(2026-01-04)
|
||||
|
||||
@@ -30,7 +30,7 @@ public class BoundedPriorityQueue<E> extends PriorityQueue<E>{
|
||||
* @param comparator 比较器
|
||||
*/
|
||||
public BoundedPriorityQueue(int capacity, final Comparator<? super E> comparator) {
|
||||
super(capacity <= 0 ? 1 : capacity, (o1, o2) -> {
|
||||
super(capacity, (o1, o2) -> {
|
||||
int cResult;
|
||||
if(comparator != null) {
|
||||
cResult = comparator.compare(o1, o2);
|
||||
@@ -53,10 +53,6 @@ public class BoundedPriorityQueue<E> extends PriorityQueue<E>{
|
||||
*/
|
||||
@Override
|
||||
public boolean offer(E e) {
|
||||
if (capacity <= 0) {
|
||||
// 容量为0或负数时,不接受任何元素
|
||||
return false;
|
||||
}
|
||||
if(size() >= capacity) {
|
||||
E head = peek();
|
||||
if (this.comparator().compare(e, head) <= 0){
|
||||
|
||||
Reference in New Issue
Block a user