mirror of
https://gitee.com/dromara/hutool.git
synced 2026-02-09 09:16:26 +08:00
修复IoUtil的closeIfPosible拼写错误,新建一个closeIfPossible方法,原方法标记deprecated(issue#4047@Github)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复`ReflectUtil`中因class和Method关联导致的缓存无法回收问题(issue#4039@Github)
|
||||
* 【db 】 修复`Condition`的`Condition("discount_end_time", "!=", (String) null)`方法生成SQL时,生成SQL不符合预期要求的错误(pr#4042@Github)
|
||||
* 【core 】 修复`IoUtil`的`closeIfPosible`拼写错误,新建一个`closeIfPossible`方法,原方法标记deprecated(issue#4047@Github)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
# 5.8.40(2025-08-26)
|
||||
|
||||
@@ -1125,8 +1125,21 @@ public class IoUtil extends NioUtil {
|
||||
*
|
||||
* @param obj 可关闭对象
|
||||
* @since 4.3.2
|
||||
* @deprecated 拼写错误,请使用{@link #closeIfPossible(Object)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static void closeIfPosible(Object obj) {
|
||||
closeIfPossible( obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 尝试关闭指定对象<br>
|
||||
* 判断对象如果实现了{@link AutoCloseable},则调用之
|
||||
*
|
||||
* @param obj 可关闭对象
|
||||
* @since 5.8.41
|
||||
*/
|
||||
public static void closeIfPossible(Object obj) {
|
||||
if (obj instanceof AutoCloseable) {
|
||||
close((AutoCloseable) obj);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user