Commit 4031a36
committed
Restore correct URL/URI handling in URLImageDescriptor
The changes done with cee4631 cause an
exception when URL is passed as an argument which contains improperly
escaped characters (most noticeably whitespaces) and therefore causes an
URISyntaxException when calling URL.toURI().
This does not occur when using IPath.fromOSString(), which is the
approach that was done previously. But instead of converting this path
back to an OS-dependent string, it is instead converted to a file, to
check whether it exists and to only then convert it back to its String
representation.
A test case with an ill-formed URL has been added to avoid a similar
problem in the future.1 parent cee4631 commit 4031a36
File tree
2 files changed
+26
-8
lines changed- bundles/org.eclipse.jface/src/org/eclipse/jface/resource
- tests/org.eclipse.jface.tests/src/org/eclipse/jface/tests/images
2 files changed
+26
-8
lines changedLines changed: 7 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| 33 | + | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
254 | 253 | | |
255 | 254 | | |
256 | 255 | | |
257 | | - | |
| 256 | + | |
258 | 257 | | |
259 | 258 | | |
260 | 259 | | |
| |||
267 | 266 | | |
268 | 267 | | |
269 | 268 | | |
270 | | - | |
| 269 | + | |
271 | 270 | | |
272 | | - | |
273 | | - | |
274 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
275 | 274 | | |
276 | 275 | | |
277 | 276 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
157 | 176 | | |
158 | 177 | | |
159 | 178 | | |
| |||
0 commit comments