FFI with Java - more local refs support