diff --git a/CHANGELOG.md b/CHANGELOG.md index e27edf117..3f210786c 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ # 🚀Changelog ------------------------------------------------------------------------------------------------------------- -# 5.8.21(2023-07-08) +# 5.8.21(2023-07-18) ### 🐣新特性 * 【core 】 list 为空时,CollUtil.max等返回null而非异常(pr#1027@Gitee) @@ -22,6 +22,7 @@ * 【core 】 修复Pair序列化转换无效问题(issue#I7GPGX@Github) * 【core 】 修复TypeUtil.getTypeArgument对实现接口获取不全面问题(issue#I7CRIW@Gitee) * 【core 】 修复BeanUtil.isCommonFieldsEqual判空导致的问题 +* 【extra 】 修复CompressUtil.createArchiver 将文件压缩为tgz时文件名规则无效问题(issue#I7LLL7@Gitee) ------------------------------------------------------------------------------------------------------------- # 5.8.20(2023-06-16) diff --git a/hutool-extra/src/main/java/cn/hutool/extra/compress/archiver/StreamArchiver.java b/hutool-extra/src/main/java/cn/hutool/extra/compress/archiver/StreamArchiver.java index c2e421959..5372b7381 100755 --- a/hutool-extra/src/main/java/cn/hutool/extra/compress/archiver/StreamArchiver.java +++ b/hutool-extra/src/main/java/cn/hutool/extra/compress/archiver/StreamArchiver.java @@ -86,14 +86,13 @@ public class StreamArchiver implements Archiver { } catch (IOException e) { throw new IORuntimeException(e); } - return; - } - - final ArchiveStreamFactory factory = new ArchiveStreamFactory(charset.name()); - try { - this.out = factory.createArchiveOutputStream(archiverName, targetStream); - } catch (ArchiveException e) { - throw new CompressException(e); + } else { + final ArchiveStreamFactory factory = new ArchiveStreamFactory(charset.name()); + try { + this.out = factory.createArchiveOutputStream(archiverName, targetStream); + } catch (ArchiveException e) { + throw new CompressException(e); + } } //特殊设置