src/share/classes/sun/swing/SwingLazyValue.java

Print this page

        

*** 65,81 **** public Object createValue(final UIDefaults table) { try { ReflectUtil.checkPackageAccess(className); Class<?> c = Class.forName(className, true, null); if (methodName != null) { ! Class[] types = getClassArray(args); Method m = c.getMethod(methodName, types); makeAccessible(m); return m.invoke(c, args); } else { ! Class[] types = getClassArray(args); ! Constructor constructor = c.getConstructor(types); makeAccessible(constructor); return constructor.newInstance(args); } } catch (Exception e) { // Ideally we would throw an exception, unfortunately --- 65,81 ---- public Object createValue(final UIDefaults table) { try { ReflectUtil.checkPackageAccess(className); Class<?> c = Class.forName(className, true, null); if (methodName != null) { ! Class<?>[] types = getClassArray(args); Method m = c.getMethod(methodName, types); makeAccessible(m); return m.invoke(c, args); } else { ! Class<?>[] types = getClassArray(args); ! Constructor<?> constructor = c.getConstructor(types); makeAccessible(constructor); return constructor.newInstance(args); } } catch (Exception e) { // Ideally we would throw an exception, unfortunately
*** 94,107 **** return null; } }); } ! private Class[] getClassArray(Object[] args) { ! Class[] types = null; if (args!=null) { ! types = new Class[args.length]; for (int i = 0; i< args.length; i++) { /* PENDING(ges): At present only the primitive types used are handled correctly; this should eventually handle all primitive types */ if (args[i] instanceof java.lang.Integer) { --- 94,107 ---- return null; } }); } ! private Class<?>[] getClassArray(Object[] args) { ! Class<?>[] types = null; if (args!=null) { ! types = new Class<?>[args.length]; for (int i = 0; i< args.length; i++) { /* PENDING(ges): At present only the primitive types used are handled correctly; this should eventually handle all primitive types */ if (args[i] instanceof java.lang.Integer) {