We have not previously seen the syntax for specifying the signature of a Java method (line 37). A method with the signature
void doThis( String s, int i, MyPackage.MyClass m )Would be encoded as
"doThis", "(Ljava/lang/String;ILMyPackage/MyClass;)V"The method name (represented as a string literal) is the second argument to the JNI function GetMethodId() (the name for any constructor is always "<init>"). The return type and argument types are all squashed together in a string literal and passed as the third argument. The argument types appear inside of parentheses, and the return type is concatenated at the end. The actual type codes were listed in the table of the previous example.
Note that the semicolon at the end of the 'L' type is the terminator of that parameter type, not a separator between parameter types. This is why there is no semicolon between the int code and the subsequent class code. Also note that in this encoding scheme, you must use '/' instead of '.' to separate the package and class names.
Once you have a Java exception object created, you then use the JNI function Throw() (line 39), and, a return statement (line 40).
[source: Horstmann98, pp609-614]