mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix buf
This commit is contained in:
parent
4c7ac0042c
commit
60dd7ce563
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# 5.8.4.M1 (2022-06-14)
|
# 5.8.4.M1 (2022-06-16)
|
||||||
|
|
||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
* 【extra 】 Sftp增加构造重载,支持超时(pr#653@Gitee)
|
* 【extra 】 Sftp增加构造重载,支持超时(pr#653@Gitee)
|
||||||
@ -11,6 +11,7 @@
|
|||||||
* 【json 】 修改byte[]统一转换为数组形式(issue#2377@Github)
|
* 【json 】 修改byte[]统一转换为数组形式(issue#2377@Github)
|
||||||
*
|
*
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
|
* 【extra 】 修复createExtractor中抛出异常后流未关闭问题(issue#2384@Github)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -142,6 +142,14 @@ public class ReUtilTest {
|
|||||||
Assert.assertEquals("我有个\\$符号\\{\\}", escape);
|
Assert.assertEquals("我有个\\$符号\\{\\}", escape);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void escapeTest2(){
|
||||||
|
String str = "a[bbbc";
|
||||||
|
String re = "[";
|
||||||
|
final String s = ReUtil.get(ReUtil.escape(re), str, 0);
|
||||||
|
Assert.assertEquals("[", s);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getAllGroupsTest() {
|
public void getAllGroupsTest() {
|
||||||
//转义给定字符串,为正则相关的特殊符号转义
|
//转义给定字符串,为正则相关的特殊符号转义
|
||||||
|
@ -59,7 +59,8 @@ public class StreamExtractor implements Extractor{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构造
|
* 构造<br>
|
||||||
|
* 如果抛出异常,则提供的流将被关闭
|
||||||
*
|
*
|
||||||
* @param charset 编码
|
* @param charset 编码
|
||||||
* @param archiverName 归档包格式,null表示自动检测
|
* @param archiverName 归档包格式,null表示自动检测
|
||||||
@ -75,6 +76,8 @@ public class StreamExtractor implements Extractor{
|
|||||||
this.in = factory.createArchiveInputStream(archiverName, in);
|
this.in = factory.createArchiveInputStream(archiverName, in);
|
||||||
}
|
}
|
||||||
} catch (ArchiveException e) {
|
} catch (ArchiveException e) {
|
||||||
|
// issue#2384,如果报错可能持有文件句柄,导致无法删除文件
|
||||||
|
IoUtil.close(in);
|
||||||
throw new CompressException(e);
|
throw new CompressException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,4 +204,11 @@ public class HttpRequestTest {
|
|||||||
HttpRequest httpRequest = new HttpRequest(urlBuilder);
|
HttpRequest httpRequest = new HttpRequest(urlBuilder);
|
||||||
httpRequest.setMethod(Method.GET).execute();
|
httpRequest.setMethod(Method.GET).execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void get122Test(){
|
||||||
|
String url = "http://122.112.234.240:9007/monitor/devices/real/59312710/all/0";
|
||||||
|
final String s = HttpUtil.get(url);
|
||||||
|
Console.log(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,8 @@ public class JSONParser {
|
|||||||
case ';':
|
case ';':
|
||||||
case ',':
|
case ',':
|
||||||
if (tokener.nextClean() == '}') {
|
if (tokener.nextClean() == '}') {
|
||||||
|
// issue#2380
|
||||||
|
// 尾后逗号(Trailing Commas),JSON中虽然不支持,但是ECMAScript 2017支持,此处做兼容。
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tokener.back();
|
tokener.back();
|
||||||
|
Loading…
Reference in New Issue
Block a user