1266 for (int i = 0; i < interfaces.length; i++) { 1267 if (isSubclass(interfaces[i], b)) { 1268 return true; 1269 } 1270 } 1271 } 1272 } 1273 return false; 1274 } 1275 1276 /** 1277 * Try to create an instance of a named class. 1278 * First try the classloader of "sibling", then try the system 1279 * classloader then the class loader of the current Thread. 1280 */ 1281 static Object instantiate(Class<?> sibling, String className) 1282 throws InstantiationException, IllegalAccessException, 1283 ClassNotFoundException { 1284 // First check with sibling's classloader (if any). 1285 ClassLoader cl = sibling.getClassLoader(); 1286 Class<?> cls = ClassFinder.findClass(className, cl); 1287 return cls.newInstance(); 1288 } 1289 1290 } // end class Introspector 1291 1292 //=========================================================================== 1293 1294 /** 1295 * Package private implementation support class for Introspector's 1296 * internal use. 1297 * <p> 1298 * Mostly this is used as a placeholder for the descriptors. 1299 */ 1300 1301 class GenericBeanInfo extends SimpleBeanInfo { 1302 1303 private BeanDescriptor beanDescriptor; 1304 private EventSetDescriptor[] events; 1305 private int defaultEvent; 1306 private PropertyDescriptor[] properties; 1307 private int defaultProperty; | 1266 for (int i = 0; i < interfaces.length; i++) { 1267 if (isSubclass(interfaces[i], b)) { 1268 return true; 1269 } 1270 } 1271 } 1272 } 1273 return false; 1274 } 1275 1276 /** 1277 * Try to create an instance of a named class. 1278 * First try the classloader of "sibling", then try the system 1279 * classloader then the class loader of the current Thread. 1280 */ 1281 static Object instantiate(Class<?> sibling, String className) 1282 throws InstantiationException, IllegalAccessException, 1283 ClassNotFoundException { 1284 // First check with sibling's classloader (if any). 1285 ClassLoader cl = sibling.getClassLoader(); 1286 @SuppressWarnings("deprecation") 1287 Object result = ClassFinder.findClass(className, cl).newInstance(); 1288 return result; 1289 } 1290 1291 } // end class Introspector 1292 1293 //=========================================================================== 1294 1295 /** 1296 * Package private implementation support class for Introspector's 1297 * internal use. 1298 * <p> 1299 * Mostly this is used as a placeholder for the descriptors. 1300 */ 1301 1302 class GenericBeanInfo extends SimpleBeanInfo { 1303 1304 private BeanDescriptor beanDescriptor; 1305 private EventSetDescriptor[] events; 1306 private int defaultEvent; 1307 private PropertyDescriptor[] properties; 1308 private int defaultProperty; |