diff options
author | Michal Cmarada <mcmarada@cisco.com> | 2018-10-01 16:26:31 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-02 12:39:51 +0000 |
commit | 5507192339aed14634929b3e8d7c5d3e5ea8f997 (patch) | |
tree | 3269fb23b8bc11082626c1dd1b871cc9842a95c3 /extras | |
parent | 2d3c7b9c4555ea4467253b0590c9aa1a6c644b4d (diff) |
Fix JVPP enum _host_to_net_ translation (VPP-1438)
- use ordinal value of enumeration instead of accessing
its value directly.
Change-Id: I6327a8f7668852846907a92c2713de9ff90c1c75
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'extras')
-rwxr-xr-x | extras/japi/java/jvpp/gen/jvppgen/jni_type_handlers_gen.py | 4 |
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}; }""") |