Skip to content

Commit c10e940

Browse files
Enable deprecation warnings and fix deprecated URL constructor
1 parent da11e62 commit c10e940

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ java {
2828
}
2929
}
3030

31+
tasks.withType(JavaCompile).configureEach {
32+
options.compilerArgs << '-Xlint:deprecation'
33+
}
34+
3135
jar {
3236
manifest {
3337
attributes(

src/main/java/co/ipregistry/datasets/IpregistryDataset.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import lombok.Getter;
55

66
import java.io.*;
7-
import java.net.URL;
7+
import java.net.URI;
88
import java.nio.file.Files;
99
import java.nio.file.Path;
1010
import java.nio.file.Paths;
@@ -158,9 +158,9 @@ public CompletableFuture<Void> update(
158158
final Path outputPath = outputDirectory2.resolve(remoteDatasetFileName + "_" + UUID.randomUUID());
159159

160160
try (
161-
BufferedInputStream in = new BufferedInputStream(new URL(
161+
BufferedInputStream in = new BufferedInputStream(URI.create(
162162
"https://download.ipregistry.co/" + remoteDatasetFileName + ".mmdb?key=" + secretKey
163-
).openStream());
163+
).toURL().openStream());
164164
FileOutputStream out = new FileOutputStream(outputPath.toFile())) {
165165

166166
byte[] dataBuffer = new byte[1024];

0 commit comments

Comments
 (0)