Skip to content

Commit b9d8b69

Browse files
committed
Stop using deprecated URL constructor in test
Only private method change so should be safe.
1 parent 1d2149c commit b9d8b69

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/ExtensionsSortTests.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2014, 2015 IBM Corporation and others.
2+
* Copyright (c) 2014, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -19,7 +19,8 @@
1919

2020
import java.io.IOException;
2121
import java.net.MalformedURLException;
22-
import java.net.URL;
22+
import java.net.URI;
23+
import java.net.URISyntaxException;
2324
import org.eclipse.core.runtime.FileLocator;
2425
import org.eclipse.core.runtime.IExtension;
2526
import org.eclipse.core.runtime.IExtensionPoint;
@@ -83,13 +84,16 @@ public void testSortOrder() {
8384
assertTrue(intermediateIndex < leafIndex);
8485
}
8586

86-
/** Bundle#installBundle() doesn't like platform:/plugin/-style URLs */
87+
/**
88+
* Bundle#installBundle() doesn't like platform:/plugin/-style URLs
89+
*/
8790
private String toFileURL(String url) throws MalformedURLException,
88-
IOException {
89-
return FileLocator.toFileURL(new URL(url)).toString();
91+
IOException, URISyntaxException {
92+
return FileLocator.toFileURL(new URI(url).toURL()).toString();
9093
}
9194

9295
private int indexOf(IExtension[] extensions, String id) {
96+
9397
for (int i = 0; i < extensions.length; i++) {
9498
if (id.equals(extensions[i].getUniqueIdentifier())) {
9599
return i;

0 commit comments

Comments
 (0)