publicstaticvoid main(String[] args) {
System.loadLibrary(args[0]);
System.out.println("JNI Type is: " + GetJniType()); long expect_ptr_id = GetId(PtrCls.class, "doNothingPtr");
DbgPrint(String.format("expected_ptr_id is 0x%x", expect_ptr_id)); if (expect_ptr_id % 4 != 0) { thrownew Error("ID " + expect_ptr_id + " is not aligned!");
} else {
System.out.println("pointer ID looks like a pointer!");
}
SetToPointerIds();
System.out.println("JNI Type is: " + GetJniType()); long expect_ptr_id2 = GetId(IdxCls.class, "doNothingIdx");
DbgPrint(String.format("expected_ptr_id2 is 0x%x", expect_ptr_id2)); if (expect_ptr_id2 % 4 != 0) { thrownew Error("ID " + expect_ptr_id + " is not aligned!");
} else {
System.out.println("pointer2 ID looks like a pointer!");
} long again_ptr_id = GetId(PtrCls.class, "doNothingPtr"); if (expect_ptr_id != again_ptr_id) { thrownew Error( "Got different id values for same method. " + expect_ptr_id + " vs " + again_ptr_id);
} else {
System.out.println("pointer ID remains a pointer!");
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.