Java native methods. Public vs. private
|Added at||2017-01-05 00:01|
Assume that we need to implement some java method in native code and expose it to user. We know that all work is done by native side, i.e. the only responsibility of java code is to pass user-supplied arguments to native code and return result back. According to this, java layer may be implemented in two ways:
I've seen both approaches in real projects and even both former and latter in the same project.
So, my question is: does any of mentioned alternatives have some technical or performance or maintainability advantages, that should encourage to use only one variant. Or maybe it is all just a matter of taste?