This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Inappropriate error message on casting to <string>
- To: kawa at sourceware dot cygnus dot com
- Subject: Inappropriate error message on casting to <string>
- From: Jocelyn Paine <popx at pop3 dot ifs dot org dot uk>
- Date: Sat, 8 Sep 2001 13:38:04 +0100 (GMT)
I defined a function f with return type <string>, which called another
function g with return type <java.lang.String>. Took me some time to find
the error (assuming it is an error to try coercing String to <string>, it
would be convenient if this coercion were automatic), because of the error
message. Which is
Invalid parameter, was: null
java.lang.ClassCastException
First, it talks about 'parameter' when it should say 'result'; second, it
says the value was null when it isn't. So I spent some time going off in
the wrong direction, looking for missing parameters and other potential
sources of nulls. I think it could also be useful if the two classes - the
class being coerced, and what it was being coerced to - were reported.
Jocelyn Paine
http://www.ifs.org.uk/~popx/
+44 (0)7768 534 091