Skip to content

Commit 0358a66

Browse files
committed
Resolve deprecated URL constructors
1 parent d33acf0 commit 0358a66

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/net/sourceforge/vietocr/util/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static File getBaseDir(Object aType) {
4242

4343
try {
4444
if (dir.toString().startsWith("jar:")) {
45-
dir = new URL(dir.toString().replaceFirst("^jar:", "").replaceFirst("/[^/]+.jar!.*$", ""));
45+
dir = new URI(dir.toString().replaceFirst("^jar:", "").replaceFirst("/[^/]+.jar!.*$", "")).toURL();
4646
dbDir = new File(dir.toURI());
4747
}
4848
} catch (MalformedURLException | URISyntaxException e) {

src/net/sourceforge/vietpad/components/FontDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public static File getBaseDir(Object aType) {
318318

319319
try {
320320
if (dir.toString().startsWith("jar:")) {
321-
dir = new URL(dir.toString().replaceFirst("^jar:", "").replaceFirst("/[^/]+.jar!.*$", ""));
321+
dir = new URI(dir.toString().replaceFirst("^jar:", "").replaceFirst("/[^/]+.jar!.*$", "")).toURL();
322322
dbDir = new File(dir.toURI());
323323
}
324324
} catch (MalformedURLException | URISyntaxException e) {

0 commit comments

Comments
 (0)