|
1 | 1 | /******************************************************************************* |
2 | | - * Copyright (c) 2014, 2015 IBM Corporation and others. |
| 2 | + * Copyright (c) 2014, 2025 IBM Corporation and others. |
3 | 3 | * |
4 | 4 | * This program and the accompanying materials |
5 | 5 | * are made available under the terms of the Eclipse Public License 2.0 |
|
19 | 19 |
|
20 | 20 | import java.io.IOException; |
21 | 21 | import java.net.MalformedURLException; |
22 | | -import java.net.URL; |
| 22 | +import java.net.URI; |
| 23 | +import java.net.URISyntaxException; |
23 | 24 | import org.eclipse.core.runtime.FileLocator; |
24 | 25 | import org.eclipse.core.runtime.IExtension; |
25 | 26 | import org.eclipse.core.runtime.IExtensionPoint; |
@@ -83,13 +84,16 @@ public void testSortOrder() { |
83 | 84 | assertTrue(intermediateIndex < leafIndex); |
84 | 85 | } |
85 | 86 |
|
86 | | - /** Bundle#installBundle() doesn't like platform:/plugin/-style URLs */ |
| 87 | + /** |
| 88 | + * Bundle#installBundle() doesn't like platform:/plugin/-style URLs |
| 89 | + */ |
87 | 90 | 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(); |
90 | 93 | } |
91 | 94 |
|
92 | 95 | private int indexOf(IExtension[] extensions, String id) { |
| 96 | + |
93 | 97 | for (int i = 0; i < extensions.length; i++) { |
94 | 98 | if (id.equals(extensions[i].getUniqueIdentifier())) { |
95 | 99 | return i; |
|
0 commit comments