Skip to content

Commit

Permalink
fix api
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Nov 12, 2023
2 parents 60ad93f + 56fae16 commit b4be88d
Show file tree
Hide file tree
Showing 105 changed files with 1,302 additions and 412 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@

# 🚀Changelog

-------------------------------------------------------------------------------------------------------------
# 5.8.23(2023-11-12)

### 🐣新特性
* 【json 】 改进TemporalAccessorSerializer支持dayOfMonth和month枚举名(issue#I82AM8@Gitee)
* 【core 】 新增ProxySocketFactory
* 【http 】 UserAgent增加百度浏览器识别(issue#I847JY@Gitee)
* 【core 】 ReflectUtil.getFieldsValue增加Filter重载(pr#1090@Gitee)
* 【core 】 Snowflake增加方法:根据传入时间戳,计算ID起终点(pr#1096@Gitee)
* 【core 】 PathUtil增加loopFiles重载,可选是否追踪软链(issue#3353@Github)

### 🐞Bug修复
* 【cron 】 修复Cron表达式range解析错误问题(issue#I82CSH@Gitee)
* 【core 】 修复VersionComparator在极端数据排序时候违反了自反性问题(issue#I81N3H@Gitee)
* 【json 】 修复JSONStrFormatter:format函数对于转义符号处理逻辑错误问题(issue#I84V6I@Gitee)
* 【core 】 修复特定情况下BiMap覆盖Value后,仍能通过旧Value查询到Key问题(issue#I88R5M@Gitee)
* 【core 】 修复aop的afterException无法生效问题(issue#3329@Github)
* 【core 】 修复TypeUtil.getClass方法强转报错问题(pr#1092@Github)
* 【core 】 修复DataSize.parse(size)不支持空格问题(issue#I88Z4Z@Gitee)
* 【http 】 修复SimpleServer在添加的HttpFilter中有获取请求参数时报错问题(issue#3343@Github)
* 【http 】 修复options请求无响应体问题
* 【core 】 ImgUtil的sliceByRowsAndCols背景无法透明问题(issue#3347@Github)
* 【core 】 修复ClassUtil#scanJar未正确关闭文件问题(issue#3361@Github)
* 【db 】 修复Column.getDigit返回值错误问题(issue#3370@Github)
* 【core 】 修复合成注解在并发环境无法保证正确缓存属性值的问题(pr#1097@Gitee)
* 【core 】 修复CollectorUtil.reduceListMap与collectors.groupby一起使用时出现与预期不符问题(pr#1102@Gitee)

-------------------------------------------------------------------------------------------------------------
# 5.8.22(2023-09-13)

Expand Down
20 changes: 10 additions & 10 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@

-------------------------------------------------------------------------------

<p align="center">
<a href="#">
<img alt="" src="https://plus.hutool.cn/images/zanzhu.jpg"/></a>
</p>

-------------------------------------------------------------------------------

[**🌎中文说明**](README.md)

-------------------------------------------------------------------------------
Expand Down Expand Up @@ -144,18 +151,18 @@ We provide the T-Shirt and Sweater with Hutool Logo, please visit the shop:
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.22</version>
<version>5.8.23</version>
</dependency>
```

### 🍐Gradle
```
implementation 'cn.hutool:hutool-all:5.8.22'
implementation 'cn.hutool:hutool-all:5.8.23'
```

## 📥Download

- [Maven Repo](https://repo1.maven.org/maven2/cn/hutool/hutool-all/5.8.22/)
- [Maven Repo](https://repo1.maven.org/maven2/cn/hutool/hutool-all/5.8.23/)

> 🔔️note:
> Hutool 5.x supports JDK8+ and is not tested on Android platforms, and cannot guarantee that all tool classes or tool methods are available.
Expand Down Expand Up @@ -208,10 +215,3 @@ Hutool welcomes anyone to contribute code to Hutool, but the author suffers from
## ⭐Star Hutool

[![Stargazers over time](https://starchart.cc/dromara/hutool.svg)](https://starchart.cc/dromara/hutool)

## 📌WeChat Official Account

<div align="center">
<img src="https://cdn.jsdelivr.net/gh/looly/hutool-site/images/qr_tuling.jpg" height="150">
<img src="https://dromara.org/img/qrcode/qrcode_1.png" height="150">
</div>
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@

-------------------------------------------------------------------------------

<p align="center">
<a href="#">
<img alt="" src="https://plus.hutool.cn/images/zanzhu.jpg"/></a>
</p>

-------------------------------------------------------------------------------

[**🌎English Documentation**](README-EN.md)

-------------------------------------------------------------------------------
Expand Down Expand Up @@ -137,20 +144,20 @@ Hutool = Hu + tool,是原公司项目底层代码剥离后的开源库,“Hu
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.22</version>
<version>5.8.23</version>
</dependency>
```

### 🍐Gradle
```
implementation 'cn.hutool:hutool-all:5.8.22'
implementation 'cn.hutool:hutool-all:5.8.23'
```

### 📥下载jar

点击以下链接,下载`hutool-all-X.X.X.jar`即可:

- [Maven中央库](https://repo1.maven.org/maven2/cn/hutool/hutool-all/5.8.22/)
- [Maven中央库](https://repo1.maven.org/maven2/cn/hutool/hutool-all/5.8.23/)

> 🔔️注意
> Hutool 5.x支持JDK8+,对Android平台没有测试,不能保证所有工具类或工具方法可用。
Expand Down Expand Up @@ -211,9 +218,3 @@ Hutool欢迎任何人为Hutool添砖加瓦,贡献代码,不过维护者是
## ⭐Star Hutool

[![Stargazers over time](https://starchart.cc/dromara/hutool.svg)](https://starchart.cc/dromara/hutool)

## 📌 知识星球

<div align="center">
<img src="https://hutool.cn/images/dromara/zsxq.jpg" height="150">
</div>
5 changes: 4 additions & 1 deletion bin/javadoc.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash

exec mvn javadoc:javadoc
#exec mvn javadoc:javadoc

# 多模块聚合文档,生成在target/site/apidocs
exec mvn javadoc:aggregate
2 changes: 1 addition & 1 deletion bin/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.8.22
5.8.23
93 changes: 69 additions & 24 deletions docs/apidocs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,77 @@
<html lang="zh">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="content-type" content="text/html">
<title>Hutool API Docs</title>
<style>
*{margin: 0; padding: 0; border: 0;}
iframe {width: 100%; display:block;}
</style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
border: 0;
}

.left {
position: absolute;
width: 20%;
height: 100%;
}

.top {
height: 10%;
text-align: center;
}

.bottom {
height: 90%;
}

.content {
position: absolute;
width: 80%;
height: 100%;
margin-left: 20%;
}

iframe {
width: 100%;
display: block;
}
</style>
<!-- 百度统计 -->
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?f2c884fc06fca522c4105429259b8a73";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</head>

<body>
<div id="left" style="position: absolute; width: 20%; height: 100%;">
<div style="height: 10%; text-align: center;">
<img src="https://plus.hutool.cn/images/hutool.svg" style="width: 50%;" />
</div>
<iframe src="overview-frame.html" title="left-top" name="left-top" style="height:30%;" ></iframe>
<iframe src="allclasses-frame.html" title="left-bottom" name="left-bottom" style="height: 60%;"></iframe>
</div>
<div id="right" style="position: absolute; margin-left: 20%; width: 80%;height: 100%;">
<iframe src="overview-summary.html" title="right" name="right" style="height: 100%;"></iframe>
</div>
<!-- wwads -->
<div style="position: fixed; right: 13px; bottom: 45px; z-index: 99999;">
<div class="wwads-cn wwads-vertical" data-id="126" style="max-width:150px"></div>
</div>
<script type="text/javascript" charset="UTF-8" src="https://cdn.wwads.cn/js/makemoney.js" async></script>
<div class="left">
<div class="top">
<a href="https://hutool.cn" target="_blank">
<img src="https://plus.hutool.cn/images/hutool.svg" style="height: 100%; width: 100%;" alt="hutool">
</a>
</div>
<div class="bottom">
<iframe src="overview-frame.html" name="packageListFrame" target="packageFrame" title="所有程序包"
style="height: 30%;"></iframe>
<iframe src="allclasses-frame.html" name="packageFrame" target="classFrame" title="所有类和接口 (除了非静态嵌套类型)"
style="height: 70%;"></iframe>
</div>
</div>
<div class="content">
<iframe src="overview-summary.html" name="classFrame" title="程序包, 类和接口说明" style="height: 100%;"></iframe>
</div>
<script type="text/javascript" charset="UTF-8" src="https://cdn.wwads.cn/js/makemoney.js" async></script>
<!-- wwads -->
<div style="position: fixed; right: 16px; bottom: 45px; z-index: 99999;">
<div class="wwads-cn wwads-vertical" data-id="126" style="max-width:150px"></div>
</div>
</body>

</html>
</html>
2 changes: 1 addition & 1 deletion docs/js/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var version = '5.8.22'
var version = '5.8.23'
2 changes: 1 addition & 1 deletion hutool-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>5.8.22</version>
<version>5.8.23</version>
</parent>

<artifactId>hutool-all</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-aop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>5.8.22</version>
<version>5.8.23</version>
</parent>

<artifactId>hutool-aop</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ public Object intercept(Object obj, Method method, Object[] args, MethodProxy pr
try {
// result = proxy.invokeSuper(obj, args);
result = proxy.invoke(target, args);
} catch (InvocationTargetException e) {
} catch (final Throwable e) {
Throwable throwable = e;
if(throwable instanceof InvocationTargetException){
throwable = ((InvocationTargetException) throwable).getTargetException();
}
// 异常回调(只捕获业务代码导致的异常,而非反射导致的异常)
if (aspect.afterException(target, method, args, e.getTargetException())) {
throw e;
if (aspect.afterException(target, method, args, throwable)) {
throw throwable;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,14 @@ public Object intercept(Object obj, Method method, Object[] args, MethodProxy pr
try {
// result = proxy.invokeSuper(obj, args);
result = proxy.invoke(target, args);
} catch (InvocationTargetException e) {
} catch (Throwable e) {
Throwable throwable = e;
if(throwable instanceof InvocationTargetException){
throwable = ((InvocationTargetException) throwable).getTargetException();
}

// 异常回调(只捕获业务代码导致的异常,而非反射导致的异常)
if (aspect.afterException(target, method, args, e.getTargetException())) {
if (aspect.afterException(target, method, args, throwable)) {
throw e;
}
}
Expand Down
2 changes: 1 addition & 1 deletion hutool-bloomFilter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>5.8.22</version>
<version>5.8.23</version>
</parent>

<artifactId>hutool-bloomFilter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>5.8.22</version>
<version>5.8.23</version>
</parent>

<artifactId>hutool-bom</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>5.8.22</version>
<version>5.8.23</version>
</parent>

<artifactId>hutool-cache</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-captcha/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>5.8.22</version>
<version>5.8.23</version>
</parent>

<artifactId>hutool-captcha</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion hutool-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>5.8.22</version>
<version>5.8.23</version>
</parent>

<artifactId>hutool-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;

import java.lang.annotation.Annotation;
import java.util.Collection;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;

/**
* {@link AnnotationSynthesizer}的基本实现
Expand Down Expand Up @@ -158,11 +158,19 @@ public Map<Class<? extends Annotation>, SynthesizedAnnotation> getAllSynthesized
@SuppressWarnings("unchecked")
@Override
public <A extends Annotation> A synthesize(Class<A> annotationType) {
return (A)synthesizedProxyAnnotations.computeIfAbsent(annotationType, type -> {
final SynthesizedAnnotation synthesizedAnnotation = synthesizedAnnotationMap.get(annotationType);
return ObjectUtil.isNull(synthesizedAnnotation) ?
null : synthesize(annotationType, synthesizedAnnotation);
});
A annotation = (A)synthesizedProxyAnnotations.get(annotationType);
if (Objects.nonNull(annotation)) {
return annotation;
}
synchronized (synthesizedProxyAnnotations) {
annotation = (A)synthesizedProxyAnnotations.get(annotationType);
if (Objects.isNull(annotation)) {
final SynthesizedAnnotation synthesizedAnnotation = synthesizedAnnotationMap.get(annotationType);
annotation = synthesize(annotationType, synthesizedAnnotation);
synthesizedProxyAnnotations.put(annotationType, annotation);
}
}
return annotation;
}

}
Loading

0 comments on commit b4be88d

Please sign in to comment.