The code in question is a JNI interface between a Java and a native code. The h file is produced by the javah utility, whereas the cpp file is created by human.
If the Java part is renamed then javah produces function prototypes with the corresponding names, like it should. However, nothing makes sure the functions in the cpp file are renamed as well - all compiles as usual. The problem will only arise when the Java code invokes the native API at runtime.
How could one catch a mismatch between the h file produced by javah and the implementation cpp file produced by human during the compilation?