See: Bug 7092231 <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7092231> - Remove incomplete package sun.dc from OpenJDK sources See: Bug 7092246 <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7092246> - Simplify sun.awt.geom.PathConsumer2D.RenderingEngine.getInstance()

-Ulf


Am 23.07.2011 22:35, schrieb Mario Torre:
2011/7/23 Ulf Zibis<[email protected]>:
Hi,

couldn't you use ReflectiveOperationException instead?
That's a good point, right.

Additionally you could better profit from generics:
Yeah, but I don't want to change more than needed.

And again more simple just use (no need for try...catch):

                public RenderingEngine run() {
                    String reClass =
System.getProperty("sun.java2d.renderer");
                    if ("sun.dc.DuctusRenderingEngine".equals(reClass)) {
                        return new sun.dc.DuctusRenderingEngine();
                    }
                    for (RenderingEngine re : ServiceLoader.loadInstalled(
                            RenderingEngine.class)) {
                        if (re.getClass().getName().equals(reClass)) {
                            return re;
                        }
                    }
                    return null;
                }

-Ulf
Again, I don't want to change more than needed. In this case, however,
I miss your point; as far as I know sun.dc.DuctusRenderingEngine()
cannot be instantiated, is not part of the OpenJDK distribution, so
this would not work on OpenJDK.

Cheers,
Mario

Reply via email to