< prev index next >

src/java.desktop/share/classes/com/sun/beans/finder/ConstructorFinder.java

Print this page

        

*** 65,87 **** * @throws NoSuchMethodException if constructor could not be found * or some constructors are found */ public static Constructor<?> findConstructor(Class<?> type, Class<?>...args) throws NoSuchMethodException { if (type.isPrimitive()) { ! throw new NoSuchMethodException("Primitive wrapper does not contain constructors"); } if (type.isInterface()) { ! throw new NoSuchMethodException("Interface does not contain constructors"); } if (!FinderUtils.isExported(type)) { ! throw new NoSuchMethodException("Class is not accessible"); } if (Modifier.isAbstract(type.getModifiers())) { ! throw new NoSuchMethodException("Abstract class cannot be instantiated"); } if (!Modifier.isPublic(type.getModifiers()) || !isPackageAccessible(type)) { ! throw new NoSuchMethodException("Class is not accessible"); } PrimitiveWrapperMap.replacePrimitivesWithWrappers(args); Signature signature = new Signature(type, args); try { --- 65,90 ---- * @throws NoSuchMethodException if constructor could not be found * or some constructors are found */ public static Constructor<?> findConstructor(Class<?> type, Class<?>...args) throws NoSuchMethodException { if (type.isPrimitive()) { ! throw new NoSuchMethodException("Primitive wrapper does not contain constructors:" ! + type.getName()); } if (type.isInterface()) { ! throw new NoSuchMethodException("Interface does not contain constructors:" ! + type.getName()); } if (!FinderUtils.isExported(type)) { ! throw new NoSuchMethodException("Class is not accessible:" + type.getName()); } if (Modifier.isAbstract(type.getModifiers())) { ! throw new NoSuchMethodException("Abstract class cannot be instantiated:" ! + type.getName()); } if (!Modifier.isPublic(type.getModifiers()) || !isPackageAccessible(type)) { ! throw new NoSuchMethodException("Class is not accessible:" + type.getName()); } PrimitiveWrapperMap.replacePrimitivesWithWrappers(args); Signature signature = new Signature(type, args); try {
< prev index next >