This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Inappropriate error message on casting to <string>


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 




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]