Skip to content

Commit

Permalink
Prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed May 6, 2019
2 parents bbd74ed + d471c5e commit 79a2f51
Show file tree
Hide file tree
Showing 69 changed files with 983 additions and 269 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@

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

## 4.5.8

### 新特性
* 【cron】 CronPatternUtil增加nextDateAfter方法(issue#IVYNL@Github)
* 【core】 增加RandomUtil.randomDate方法(issue#IW49T@Github)
* 【db】 Table增加comment字段,调整元信息逻辑(issue#IW49S@Gitee)
* 【core】 增加ConcurrencyTester(pr#41@Gitee)
* 【core】 ZipUtil增加对流的解压支持(issue#IW798@Gitee)

### Bug修复
* 【core】 修复Enjoy模板创建多个引擎报错问题(issue#344@Github)
* 【crypto】 修复Linux下RSA/ECB/PKCS1Padding算法无效问题
* 【core】 修复ImgUtil.scale方法操作png图片透明失效问题(issue#341@Github)
* 【core】 修复JSON自定义日期格式无引号问题(issue#IW4F6@Gitee)
* 【core】 修复Android下CallerUtil.getCallerCaller空指针问题(issue#IW68U@Gitee)
* 【cache】 修复Cache中超时太大导致Long越界问题(issue#347@Github)

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

## 4.5.7

### 新特性
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,21 @@ Hutool是Hu + tool的自造词,谐音“糊涂”,寓意追求“万事都
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.5.7</version>
<version>4.5.8</version>
</dependency>
```

### Gradle
```
compile 'cn.hutool:hutool-all:4.5.7'
compile 'cn.hutool:hutool-all:4.5.8'
```

### 非Maven项目

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

- [Maven中央库1](https://repo1.maven.org/maven2/cn/hutool/hutool-all/4.5.7/)
- [Maven中央库2](http://repo2.maven.org/maven2/cn/hutool/hutool-all/4.5.7/)
- [Maven中央库1](https://repo1.maven.org/maven2/cn/hutool/hutool-all/4.5.8/)
- [Maven中央库2](http://repo2.maven.org/maven2/cn/hutool/hutool-all/4.5.8/)

> 注意
> Hutool只支持JDK7+,对应Android平台没有测试,部分方法并不支持。
Expand Down
2 changes: 1 addition & 1 deletion bin/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.5.7
4.5.8
2 changes: 1 addition & 1 deletion docs/js/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
var version = '4.5.7'
var version = '4.5.8'
2 changes: 1 addition & 1 deletion hutool-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>4.5.7</version>
<version>4.5.8</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>4.5.7</version>
<version>4.5.8</version>
</parent>

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

<artifactId>hutool-bloomFilter</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 @@ -7,7 +7,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>4.5.7</version>
<version>4.5.8</version>
</parent>

<artifactId>hutool-cache</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public V get(K key, boolean isUpdateLastAccess) {
missCount++;
return null;
}

if (false == co.isExpired()) {
// 命中
hitCount++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ protected CacheObj(K key, V obj, long ttl) {
* @return 是否过期
*/
boolean isExpired() {
return (this.ttl > 0) && (this.lastAccess + this.ttl < System.currentTimeMillis());
if(this.ttl > 0) {
final long expiredTime = this.lastAccess + this.ttl;
if(expiredTime > 0 && expiredTime < System.currentTimeMillis()) {
// expiredTime > 0 杜绝Long类型溢出变负数问题,当当前时间超过过期时间,表示过期
return true;
}
}
return false;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public void timedCacheTest(){
timedCache.put("key1", "value1", 1);//1毫秒过期
timedCache.put("key2", "value2", DateUnit.SECOND.getMillis() * 5);//5秒过期
timedCache.put("key3", "value3");//默认过期(4毫秒)
timedCache.put("key4", "value4", Long.MAX_VALUE);//永不过期

//启动定时任务,每5毫秒秒检查一次过期
timedCache.schedulePrune(5);
Expand All @@ -82,11 +83,16 @@ public void timedCacheTest(){
String value1 = timedCache.get("key1");
Assert.assertTrue(null == value1);
String value2 = timedCache.get("key2");
Assert.assertFalse(null == value2);
Assert.assertEquals("value2", value2);

//5毫秒后,由于设置了默认过期,key3只被保留4毫秒,因此为null
String value3 = timedCache.get("key3");
Assert.assertTrue(null == value3);

// 永不过期
String value4 = timedCache.get("key4");
Assert.assertEquals("value4", value4);

//取消定时清理
timedCache.cancelPruneSchedule();
}
Expand Down
2 changes: 1 addition & 1 deletion hutool-captcha/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>cn.hutool</groupId>
<artifactId>hutool-parent</artifactId>
<version>4.5.7</version>
<version>4.5.8</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>4.5.7</version>
<version>4.5.8</version>
</parent>

<artifactId>hutool-core</artifactId>
Expand Down
Loading

0 comments on commit 79a2f51

Please sign in to comment.