cxxtest.cc 399 B

12345678910111213141516171819202122232425
  1. #include <jni.h>
  2. #include <cxxtest.h>
  3. jobjectArray
  4. Java_cxxtest_fetch (JNIEnv *env, jobject _this)
  5. {
  6. jclass cls;
  7. jfieldID fid;
  8. jobjectArray obj;
  9. cls = env->GetObjectClass (_this);
  10. if (! cls)
  11. return 0;
  12. fid = env->GetFieldID (cls, "F", "[Ljava/lang/Object;");
  13. if (! fid)
  14. return 0;
  15. obj = reinterpret_cast<jobjectArray> (env->GetObjectField (_this, fid));
  16. return obj;
  17. }