Merge "Remove small duplicate code in Generic JNI handling, add comments"