Skip to content

Commit 0064602

Browse files
committed
Make java's bindings.c deterministic
1 parent 29ab964 commit 0064602

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java_strings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,10 @@ def c_fn_name_define_pfx(self, fn_name, has_args):
391391

392392
def init_str(self):
393393
res = ""
394-
for ty in self.c_array_class_caches:
394+
for ty in sorted(self.c_array_class_caches):
395395
res = res + "static jclass " + ty + "_clz = NULL;\n"
396396
res = res + "JNIEXPORT void Java_org_ldk_impl_bindings_init_1class_1cache(JNIEnv * env, jclass clz) {\n"
397-
for ty in self.c_array_class_caches:
397+
for ty in sorted(self.c_array_class_caches):
398398
res = res + "\t" + ty + "_clz = (*env)->FindClass(env, \"" + ty.replace("arr_of_", "[") + "\");\n"
399399
res = res + "\tCHECK(" + ty + "_clz != NULL);\n"
400400
res = res + "\t" + ty + "_clz = (*env)->NewGlobalRef(env, " + ty + "_clz);\n"

0 commit comments

Comments
 (0)