Add deprecation documentation to Archive.iterator
See gh-16655
This commit is contained in:
@@ -36,6 +36,7 @@ import org.junit.jupiter.api.io.TempDir;
|
||||
|
||||
import org.springframework.boot.loader.TestJarCreator;
|
||||
import org.springframework.boot.loader.archive.Archive.Entry;
|
||||
import org.springframework.boot.loader.jar.JarFile;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -171,13 +172,13 @@ class JarFileArchiveTests {
|
||||
output.write(zip64JarData);
|
||||
output.closeEntry();
|
||||
}
|
||||
try (JarFileArchive jarFileArchive = new JarFileArchive(file);
|
||||
Archive nestedArchive = jarFileArchive
|
||||
.getNestedArchive(getEntriesMap(jarFileArchive).get("nested/zip64.jar"))) {
|
||||
Iterator<Entry> it = nestedArchive.iterator();
|
||||
try (JarFile jarFile = new JarFile(file)) {
|
||||
ZipEntry nestedEntry = jarFile.getEntry("nested/zip64.jar");
|
||||
JarFile nestedJarFile = jarFile.getNestedJarFile(nestedEntry);
|
||||
Iterator<JarEntry> iterator = nestedJarFile.iterator();
|
||||
for (int i = 0; i < 65537; i++) {
|
||||
assertThat(it.hasNext()).as(i + "nth file is present").isTrue();
|
||||
it.next();
|
||||
assertThat(iterator.hasNext()).as(i + "nth file is present").isTrue();
|
||||
iterator.next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user