summaryrefslogtreecommitdiffstats
path: root/extras/japi/java
diff options
context:
space:
mode:
Diffstat (limited to 'extras/japi/java')
-rwxr-xr-xextras/japi/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/extras/japi/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py b/extras/japi/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py
index a76aadf468c..2447974d878 100755
--- a/extras/japi/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py
+++ b/extras/japi/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py
@@ -117,8 +117,8 @@ $json_definition
static inline void _host_to_net_${c_name}(JNIEnv * env, jobject _host, vl_api_${c_name}_t * _net)
{
jclass enumClass = (*env)->FindClass(env, "${class_FQN}");
- jfieldID valueFieldId = (*env)->GetStaticFieldID(env, enumClass, "value", "${jni_signature}");
- ${jni_type} value = (*env)->GetStatic${jni_accessor}Field(env, enumClass, valueFieldId);
+ jmethodID getValueMethod = (*env)->GetMethodID(env, enumClass, "ordinal", "()I");
+ ${jni_type} value = (*env)->CallIntMethod(env, _host, getValueMethod);
${swap};
}""")