@@ -708,9 +708,8 @@ public T newInstance()
708708 );
709709 }
710710 try {
711- Class <?>[] empty = {};
712711 final Constructor <T > c = getReflectionFactory ().copyConstructor (
713- getConstructor0 (empty , Member . DECLARED ));
712+ getConstructor0 (EMPTY_CLASS_ARRAY , false ));
714713 // Disable accessibility checks on the constructor
715714 // access check is done with the true caller
716715 c .setAccessible (true );
@@ -2198,7 +2197,7 @@ public Method getMethod(String name, Class<?>... parameterTypes)
21982197 public Constructor <T > getConstructor (Class <?>... parameterTypes )
21992198 throws NoSuchMethodException {
22002199 return getReflectionFactory ().copyConstructor (
2201- getConstructor0 (parameterTypes , Member . PUBLIC ));
2200+ getConstructor0 (parameterTypes , true ));
22022201 }
22032202
22042203
@@ -2492,7 +2491,7 @@ Method findMethod(boolean publicOnly, String name, Class<?>... parameterTypes) {
24922491 public Constructor <T > getDeclaredConstructor (Class <?>... parameterTypes )
24932492 throws NoSuchMethodException {
24942493 return getReflectionFactory ().copyConstructor (
2495- getConstructor0 (parameterTypes , Member . DECLARED ));
2494+ getConstructor0 (parameterTypes , false ));
24962495 }
24972496
24982497 /**
@@ -3176,10 +3175,10 @@ private PublicMethods.MethodList getMethodsRecursive(String name,
31763175 // be propagated to the outside world, but must instead be copied
31773176 // via ReflectionFactory.copyConstructor.
31783177 private Constructor <T > getConstructor0 (Class <?>[] parameterTypes ,
3179- int which ) throws NoSuchMethodException
3178+ boolean publicOnly ) throws NoSuchMethodException
31803179 {
31813180 ReflectionFactory fact = getReflectionFactory ();
3182- Constructor <T >[] constructors = privateGetDeclaredConstructors (( which == Member . PUBLIC ) );
3181+ Constructor <T >[] constructors = privateGetDeclaredConstructors (publicOnly );
31833182 for (Constructor <T > constructor : constructors ) {
31843183 if (arrayContentsEq (parameterTypes ,
31853184 fact .getExecutableSharedParameterTypes (constructor ))) {
0 commit comments