Skip to content

Commit 887c89d

Browse files
authored
Fix file: URL query parameter handling on Windows
1 parent cd2c434 commit 887c89d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bundles/org.eclipse.jface/src/org/eclipse/jface/resource/URLImageDescriptor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ private static InputStream getStream(URL url) {
177177
if (InternalPolicy.OSGI_AVAILABLE) {
178178
url = resolvePathVariables(url);
179179
}
180+
// For file: URLs, strip query parameters before opening the stream
181+
// Query parameters are used for size hints but are not valid in file paths
182+
if (FILE_PROTOCOL.equalsIgnoreCase(url.getProtocol()) && url.getQuery() != null) {
183+
url = new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getPath());
184+
}
180185
return url.openStream();
181186
} catch (IOException e) {
182187
e.printStackTrace();

0 commit comments

Comments
 (0)