summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2019-02-12 14:20:59 +0100
committerMichal Cmarada <mcmarada@cisco.com>2019-02-12 18:23:45 +0100
commitc21d38f80d5bc5415bc5cf58f97779e542c924c9 (patch)
tree47791ba33c04eb0d79abca861426957c78c94e03 /java
parent6048b94382fc41a4ff703b5afc65c294bc3d5a1d (diff)
fix processing of enum value in jni
Change-Id: Ia18a9526190ede32b4de0eb486ee8e42e01fa644 Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'java')
-rwxr-xr-xjava/jvpp/gen/jvppgen/enums_gen.py4
-rwxr-xr-xjava/jvpp/gen/jvppgen/jni_type_handlers_gen.py2
2 files changed, 5 insertions, 1 deletions
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};
}""")