Enable deprecation compilation warnings

See gh-21271
This commit is contained in:
Andy Wilkinson
2020-06-04 12:58:29 +01:00
parent c64649a6d9
commit 056d5f3120
47 changed files with 182 additions and 168 deletions

View File

@@ -25,6 +25,7 @@ import java.net.URLClassLoader;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.jar.Attributes;
@@ -289,7 +290,7 @@ class PropertiesLauncherTests {
assertThat(loader.getClass().getName()).isEqualTo(TestLoader.class.getName());
}
private List<Archive> archives() throws Exception {
private Iterator<Archive> archives() throws Exception {
List<Archive> archives = new ArrayList<>();
String path = System.getProperty("java.class.path");
for (String url : path.split(File.pathSeparator)) {
@@ -298,7 +299,7 @@ class PropertiesLauncherTests {
archives.add(archive);
}
}
return archives;
return archives.iterator();
}
private Archive archive(String url) throws IOException {

View File

@@ -148,6 +148,7 @@ class JarFileArchiveTests {
File file = new File(this.tempDir, "test.jar");
FileCopyUtils.copy(writeZip64Jar(), file);
try (JarFileArchive zip64Archive = new JarFileArchive(file)) {
@SuppressWarnings("deprecation")
Iterator<Entry> entries = zip64Archive.iterator();
for (int i = 0; i < 65537; i++) {
assertThat(entries.hasNext()).as(i + "nth file is present").isTrue();