From c21d38f80d5bc5415bc5cf58f97779e542c924c9 Mon Sep 17 00:00:00 2001 From: Michal Cmarada Date: Tue, 12 Feb 2019 14:20:59 +0100 Subject: fix processing of enum value in jni Change-Id: Ia18a9526190ede32b4de0eb486ee8e42e01fa644 Signed-off-by: Michal Cmarada --- java/jvpp/gen/jvppgen/enums_gen.py | 4 ++++ java/jvpp/gen/jvppgen/jni_type_handlers_gen.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'java') diff --git a/java/jvpp/gen/jvppgen/enums_gen.py b/java/jvpp/gen/jvppgen/enums_gen.py index 8ba9655..6689497 100755 --- a/java/jvpp/gen/jvppgen/enums_gen.py +++ b/java/jvpp/gen/jvppgen/enums_gen.py @@ -64,6 +64,10 @@ $constants; } return null; } + + public $value_type getValue() { + return value; + } } """) diff --git a/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py b/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py index 05c3e52..d733dd5 100755 --- a/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py +++ b/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py @@ -121,7 +121,7 @@ $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}"); - jmethodID getValueMethod = (*env)->GetMethodID(env, enumClass, "ordinal", "()I"); + jmethodID getValueMethod = (*env)->GetMethodID(env, enumClass, "getValue", "()I"); ${jni_type} value = (*env)->CallIntMethod(env, _host, getValueMethod); ${swap}; }""") -- cgit 1.2.3-korg