From 00646029f611e9bbdf11ee6d90ca3404d6e5638b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sun, 21 Mar 2021 20:00:30 -0400 Subject: [PATCH] Make java's bindings.c deterministic --- java_strings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java_strings.py b/java_strings.py index eed7f398..16337564 100644 --- a/java_strings.py +++ b/java_strings.py @@ -391,10 +391,10 @@ import java.util.Arrays; def init_str(self): res = "" - for ty in self.c_array_class_caches: + for ty in sorted(self.c_array_class_caches): res = res + "static jclass " + ty + "_clz = NULL;\n" res = res + "JNIEXPORT void Java_org_ldk_impl_bindings_init_1class_1cache(JNIEnv * env, jclass clz) {\n" - for ty in self.c_array_class_caches: + for ty in sorted(self.c_array_class_caches): res = res + "\t" + ty + "_clz = (*env)->FindClass(env, \"" + ty.replace("arr_of_", "[") + "\");\n" res = res + "\tCHECK(" + ty + "_clz != NULL);\n" res = res + "\t" + ty + "_clz = (*env)->NewGlobalRef(env, " + ty + "_clz);\n" -- 2.39.5