X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FSignOrCreationError.java;h=9cb6cdd303ccbbf2425d8675dc2ccb9f701c548b;hb=8aa8a96fc6d8fcdd3fbb419b4b4c12482af14938;hp=8bc1550f1b86b9ebdb8d344cabac5cbb7f84834c;hpb=6d094e745feaf94c1059555cd1c997965a34bc36;p=ldk-java diff --git a/src/main/java/org/ldk/structs/SignOrCreationError.java b/src/main/java/org/ldk/structs/SignOrCreationError.java index 8bc1550f..9cb6cdd3 100644 --- a/src/main/java/org/ldk/structs/SignOrCreationError.java +++ b/src/main/java/org/ldk/structs/SignOrCreationError.java @@ -4,6 +4,7 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import java.lang.ref.Reference; import javax.annotation.Nullable; @@ -50,6 +51,7 @@ public class SignOrCreationError extends CommonBase { } long clone_ptr() { long ret = bindings.SignOrCreationError_clone_ptr(this.ptr); + Reference.reachabilityFence(this); return ret; } @@ -58,9 +60,10 @@ public class SignOrCreationError extends CommonBase { */ public SignOrCreationError clone() { long ret = bindings.SignOrCreationError_clone(this.ptr); + Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); + org.ldk.structs.SignOrCreationError ret_hu_conv = org.ldk.structs.SignOrCreationError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -70,8 +73,8 @@ public class SignOrCreationError extends CommonBase { public static SignOrCreationError sign_error() { long ret = bindings.SignOrCreationError_sign_error(); if (ret >= 0 && ret <= 4096) { return null; } - SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + org.ldk.structs.SignOrCreationError ret_hu_conv = org.ldk.structs.SignOrCreationError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -80,9 +83,10 @@ public class SignOrCreationError extends CommonBase { */ public static SignOrCreationError creation_error(org.ldk.enums.CreationError a) { long ret = bindings.SignOrCreationError_creation_error(a); + Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } - SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + org.ldk.structs.SignOrCreationError ret_hu_conv = org.ldk.structs.SignOrCreationError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -90,16 +94,23 @@ public class SignOrCreationError extends CommonBase { * Checks if two SignOrCreationErrors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(SignOrCreationError b) { - boolean ret = bindings.SignOrCreationError_eq(this.ptr, b == null ? 0 : b.ptr & ~1); + public boolean eq(org.ldk.structs.SignOrCreationError b) { + boolean ret = bindings.SignOrCreationError_eq(this.ptr, b == null ? 0 : b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); return ret; } + @Override public boolean equals(Object o) { + if (!(o instanceof SignOrCreationError)) return false; + return this.eq((SignOrCreationError)o); + } /** * Get the string representation of a SignOrCreationError object */ public String to_str() { String ret = bindings.SignOrCreationError_to_str(this.ptr); + Reference.reachabilityFence(this); return ret; }