From: Matt Corallo Date: Mon, 22 Mar 2021 00:00:30 +0000 (-0400) Subject: Make java's bindings.c deterministic X-Git-Tag: v0.0.98~7^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F2021-03-fresh-bindings;p=ldk-java Make java's bindings.c deterministic --- 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"