Skip to content
Snippets Groups Projects
Commit 71259210 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Use NewOject to invoke constructor of NetworkStats.Entry" into main

parents 522197af 5dfe5553
No related branches found
No related tags found
No related merge requests found
......@@ -52,8 +52,14 @@ static jobject statsValueToEntry(JNIEnv* env, StatsValue* stats) {
return nullptr;
}
// Find the constructor.
jmethodID constructorID = env->GetMethodID(gEntryClass, "<init>", "()V");
if (constructorID == nullptr) {
return nullptr;
}
// Create a new instance of the Java class
jobject result = env->AllocObject(gEntryClass);
jobject result = env->NewObject(gEntryClass, constructorID);
if (result == nullptr) {
return nullptr;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment