rem: lua_State* L; jobject* obj; jclass classCPtr = ( *env )->GetObjectClass( env , cptr ); jfieldID CPtr_peer_ID = ( *env )->GetFieldID( env , classCPtr , "peer" , "J" ); jbyte *peer = ( jbyte * )( *env )->GetLongField( env , cptr , CPtr_peer_ID );  L = ( lua_State * ) peer ;
add: lua_State * L = getStateFromCPtr( env , cptr ); jobject *   obj;
context: JNIEXPORT jobject JNICALL Java_luajava_LuaState__1getObjectFromUserdata  (JNIEnv * env , jobject jobj , jobject cptr , jint index ){   /* Get luastate */   lua_State* L;   jobject* obj;   jclass classCPtr = ( *env )->GetObjectClass( env , cptr );   jfieldID CPtr_peer_ID = ( *env )->GetFieldID( env , classCPtr , "peer" , "J" );   jbyte *peer = ( jbyte * )( *env )->GetLongField( env , cptr , CPtr_peer_ID );   L = ( lua_State * ) peer ;   if ( !isJavaObject( L , index ) )   {      ( *env )->ThrowNew( env , ( *env )->FindClass( env , "java/lang/Exception" ) ,                          "Index is not a java object" );      return NULL;   }   obj = ( jobject * ) lua_touserdata( L , index );   return *obj;}