< prev index next >

src/java.desktop/share/classes/java/beans/Introspector.java

Print this page

        

@@ -34,10 +34,11 @@
 import java.awt.Component;
 
 import java.lang.ref.Reference;
 import java.lang.ref.SoftReference;
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 
 import java.util.Map;
 import java.util.ArrayList;

@@ -1278,15 +1279,16 @@
      * First try the classloader of "sibling", then try the system
      * classloader then the class loader of the current Thread.
      */
     static Object instantiate(Class<?> sibling, String className)
                  throws InstantiationException, IllegalAccessException,
+                        NoSuchMethodException, InvocationTargetException,
                                                 ClassNotFoundException {
         // First check with sibling's classloader (if any).
         ClassLoader cl = sibling.getClassLoader();
         Class<?> cls = ClassFinder.findClass(className, cl);
-        return cls.newInstance();
+        return cls.getDeclaredConstructor().newInstance();
     }
 
 } // end class Introspector
 
 //===========================================================================
< prev index next >