< prev index next >

src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java

Print this page

        

*** 79,100 **** GraphicsPrimitive instantiate() { String name = getPackageName(owner.getName()) + "." + relativeClassName; try { Class<?> clazz = Class.forName(name); ! GraphicsPrimitive p = (GraphicsPrimitive) clazz.newInstance(); if (!satisfiesSameAs(p)) { throw new RuntimeException("Primitive " + p + " incompatible with proxy for " + name); } return p; ! } catch (ClassNotFoundException ex) { ! throw new RuntimeException(ex.toString()); ! } catch (InstantiationException ex) { ! throw new RuntimeException(ex.toString()); ! } catch (IllegalAccessException ex) { throw new RuntimeException(ex.toString()); } // A RuntimeException should never happen in a deployed JDK, because // the regression test GraphicsPrimitiveProxyTest will catch any // of these errors. --- 79,97 ---- GraphicsPrimitive instantiate() { String name = getPackageName(owner.getName()) + "." + relativeClassName; try { Class<?> clazz = Class.forName(name); ! GraphicsPrimitive p = ! (GraphicsPrimitive) clazz.getDeclaredConstructor().newInstance(); if (!satisfiesSameAs(p)) { throw new RuntimeException("Primitive " + p + " incompatible with proxy for " + name); } return p; ! } catch (ReflectiveOperationException ex) { throw new RuntimeException(ex.toString()); } // A RuntimeException should never happen in a deployed JDK, because // the regression test GraphicsPrimitiveProxyTest will catch any // of these errors.
< prev index next >