* Method.invoke() test bug
@ 2002-04-05 4:58 Mark Wielaard
0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2002-04-05 4:58 UTC (permalink / raw)
To: mauve-discuss
[-- Attachment #1: Type: text/plain, Size: 860 bytes --]
Hi,
The spec says:
For each actual parameter in the supplied args array:
If the corresponding formal parameter has a primitive type, an
unwrapping conversion is attempted to convert the object value to a
value of a primitive type. If this attempt fails, the invocation
throws an IllegalArgumentException.
If, after possible unwrapping, the parameter value cannot be
converted to the corresponding formal parameter type by an identity
or widening conversion, the invocation throws an
IllegalArgumentException.
So the following test should be changed to expect an
IllegalArgumentException and not a NullPointerException.
* gnu/testlet/java/lang/reflect/Method/invoke.java (test): Expect
IllegalArgument exception when argument for a method that takes an
int is null.
Any objections?
Cheers,
Mark
[-- Attachment #2: invoke.patch --]
[-- Type: text/x-patch, Size: 692 bytes --]
Index: gnu/testlet/java/lang/reflect/Method/invoke.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/reflect/Method/invoke.java,v
retrieving revision 1.8
diff -u -r1.8 invoke.java
--- invoke.java 2001/11/25 19:30:21 1.8
+++ invoke.java 2002/04/05 12:54:32
@@ -166,7 +166,7 @@
new IllegalArgumentException ());
args1[0] = null;
try_invoke (harness, ti_meth, null, args1,
- new NullPointerException ());
+ new IllegalArgumentException ());
args1[0] = new Integer (-5);
try_invoke (harness, ti_meth, null, args1,
new InvocationTargetException (new IllegalArgumentException ()));
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-04-05 12:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-05 4:58 Method.invoke() test bug Mark Wielaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).