< prev index next >
src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveProxy.java
Print this page
@@ -79,22 +79,19 @@
GraphicsPrimitive instantiate() {
String name = getPackageName(owner.getName()) + "."
+ relativeClassName;
try {
Class<?> clazz = Class.forName(name);
- GraphicsPrimitive p = (GraphicsPrimitive) clazz.newInstance();
+ GraphicsPrimitive p =
+ (GraphicsPrimitive) clazz.getDeclaredConstructor().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) {
+ } 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 >