Thanks Jesse and Mirko.
Just found this at:
http://developer.java.sun.com/developer/community/chat/JavaLive/1997/jl0318.html "We have to be really careful when we develop in native code. All Java built-in mechanisms on type safety and protection are no longer effective. Native methods essentially become part of the VM. The JNI is designed to minimize the number of mistakes you can make developing native methods. Still, you have to be really careful."
and
"The JNI has to be the last resort. If your application contains even one native method, the application is no longer 100% pure, and you'll lose many of the benefits of Java. However, if you absolutely need to access certain plaform-dependent features available in the standard Java library; or you have a large body of existing code in C and C++ that you do not want to throw away; or you are certain that you cannot get the performance you need with the current Java compilation technology; you may use native methods."
Seems that Jesse is more than right. You'd better be absolutely confident that the wrapped code is leak proof or suffer the probable undefined consequences.
------------------