This content has been marked as final. Show 2 replies
Just fixed my stupid buggy code. I called the private "native" Javafunction from a wrapping public function within that class. Apparently it called the private function with a string that was initialised as null. Very stupid, I admit. This really makes a case for checking within my private native functions and within my c-code for correct input.
If you look at the JDK code you will see that invariably there is a Java wrapper for each native function that does all the sanity checking it possibly can, and maybe also rearranges the output, so that the native function is only ever called with correct arguments. It's a lot easier to do the checks in Java and if you forget one it's a lot quicker to just add it to the Java code.