Commit 407a403
Throw ERROR_UNSUPPORTED_FORMAT when SVGRasterizer could not be loaded
Trying to load an SVG while the JSVG rasterizer is not in the classpath
throws a ServiceConfigurationError. This error should be caught and
transformed into an SWTError, as specified by the contract of the
ImageLoader.
By catching the ServiceConfigurationError, the RASTERIZER field is
initialized with NULL. In this state, calling any method of the
SVGFileFormat class automatically throws the expected SWTError.
To reproduce, load an SVG while `org.eclipse.swt.svg` is in the
classpath, but `com.github.weisj.jsvg` is not. This call should fail
with a:
> Provider org.eclipse.swt.svg.JSVGRasterizer could not be instantiated
Due to a NoClassDefFoundError when trying to load the JSVGRasterizer
class, caused by the unresolvable dependency.1 parent ad438ae commit 407a403
File tree
1 file changed
+12
-2
lines changed- bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image
1 file changed
+12
-2
lines changedLines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
| |||
0 commit comments