OSDN Git Service

Fix Class.getConstructor("whatever", (Class[]) null).
authorElliott Hughes <enh@google.com>
Fri, 28 Aug 2009 22:54:30 +0000 (15:54 -0700)
committerElliott Hughes <enh@google.com>
Thu, 3 Sep 2009 19:41:40 +0000 (12:41 -0700)
commitaf12a6637be4cbb9366cd88cecd22cfc82087086
tree3722484c0be3af39a5580ae943a41479a5a4da47
parentf7fb00865dd05c32aab5b968fd79ae0ef63e9d6c
Fix Class.getConstructor("whatever", (Class[]) null).

The RI treats null parameterTypes the same as an empty array.
This behavior is specified for getMethod, but only implied for getConstructor.

This patch:

* Fixes getConstructor.
* Improves javadoc for Class methods taking "Class... parameterTypes".
* Adds tests for both getConstructor and getMethod (which was already correct).
* Removes a line of debugging output to System.out.

Bug: 1824973
libcore/luni-kernel/src/main/java/java/lang/Class.java
libcore/luni/src/test/java/tests/api/java/lang/reflect/ConstructorTest.java
libcore/luni/src/test/java/tests/api/java/lang/reflect/MethodTest.java