Skip to content

Commit eedcd72

Browse files
committed
Fixup warnings due to deprecated URL constructor (in Edge/IE)
These calls are covered by existing Browser test cases. Needed to resolve new warnings due to update to Java21 #2824
1 parent 8adb20e commit eedcd72

File tree

2 files changed

+4
-4
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser

2 files changed

+4
-4
lines changed

bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ private static record MouseRelatedDomEvent(String eventType, boolean altKey, boo
185185
HttpCookie parser = HttpCookie.parse(CookieValue).get(0);
186186
URL origin;
187187
try {
188-
origin = new URL(CookieUrl);
189-
} catch (MalformedURLException e) {
188+
origin = new URI(CookieUrl).toURL();
189+
} catch (URISyntaxException | IllegalArgumentException | MalformedURLException e) {
190190
return;
191191
}
192192
if (parser.getDomain() == null) {

bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,8 @@ else if (IEVersion >= 8) {
717717
boolean isPDF = false;
718718
String path = null;
719719
try {
720-
path = new URL(url3).getPath();
721-
} catch (MalformedURLException e) {
720+
path = new URI(url3).toURL().getPath();
721+
} catch (URISyntaxException | IllegalArgumentException | MalformedURLException e) {
722722
}
723723
if (path != null) {
724724
int extensionIndex = path.lastIndexOf('.');

0 commit comments

Comments
 (0)