</BUG>
writer.print("    (*env)->ReleasePrimitiveArrayCritical(env, " + javaArgName + ", " + convName + ", "+modeFlag+");");
} else {
writer.println("  if ( NULL != " + javaArgName + " ) {");
<BUG>if (!isBaseTypeConst(cArgType)) {
</BUG>
if (javaArgType.isArrayOfCompoundTypeWrappers()) {
writer.println("    _tmpArrayLen = (*env)->GetArrayLength(env, " + javaArgName + ");");
writer.println("    for (_copyIndex = 0; _copyIndex < _tmpArrayLen; ++_copyIndex) {");
writer.println("      _tmpObj = (*env)->GetObjectArrayElement(env, " + javaArgName + ", _copyIndex);");

javaArgType.isArrayOfCompoundTypeWrappers()) {
final boolean needsDataCopy = javaArgTypeNeedsDataCopy(javaArgType);
final String convName = pointerConversionArgumentName(javaArgName);
if (!needsDataCopy) {
writer.println("  if ( JNI_FALSE == " + isNIOArgName(i) + " && NULL != " + javaArgName + " ) {");
final String modeFlag = cArgType.isBaseTypeConst() ? "JNI_ABORT" : "0" ;
writer.print("    (*env)->ReleasePrimitiveArrayCritical(env, " + javaArgName + ", " + convName + ", "+modeFlag+");");
} else {
writer.println("  if ( NULL != " + javaArgName + " ) {");
if (!cArgType.isBaseTypeConst()) {
if (javaArgType.isArrayOfCompoundTypeWrappers()) {
writer.println("    _tmpArrayLen = (*env)->GetArrayLength(env, " + javaArgName + ");");
writer.println("    for (_copyIndex = 0; _copyIndex < _tmpArrayLen; ++_copyIndex) {");
writer.println("      _tmpObj = (*env)->GetObjectArrayElement(env, " + javaArgName + ", _copyIndex);");
