Fix #5326 修改在构建文件树时遇到重名文件夹导致读取失败的问题 (#5369)

Co-authored-by: Glavo <zjx001202@gmail.com>
This commit is contained in:
NoClassDefFoundError
2026-02-09 20:42:10 +08:00
committed by GitHub
parent dc993b871f
commit 64821600c5

View File

@@ -129,10 +129,10 @@ public abstract class ArchiveFileTree<R, E extends ArchiveEntry> implements Clos
} }
if (entry.isDirectory()) { if (entry.isDirectory()) {
if (dir.entry != null) { if (dir.entry == null)
throw new IOException("Duplicate entry: " + entry.getName()); dir.entry = entry;
} else if (!dir.entry.isDirectory())
dir.entry = entry; throw new IOException("A file and a directory have the same name: " + entry.getName());
} else { } else {
String fileName = path[path.length - 1]; String fileName = path[path.length - 1];