X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FPing.java;h=5c7026be8afa5a4f7d79f6125d84a881e85e66c8;hb=6fa67d9d6fc0321d8bc1798f5be614a96982f75e;hp=d893cf3a88ed5217bc4c4ce98e29c5cd98c232c6;hpb=b6cc0960eaee5a5bbc7fde79a56152d6dcd649d8;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Ping.java b/src/main/java/org/ldk/structs/Ping.java index d893cf3a..5c7026be 100644 --- a/src/main/java/org/ldk/structs/Ping.java +++ b/src/main/java/org/ldk/structs/Ping.java @@ -4,6 +4,8 @@ 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; /** @@ -23,6 +25,7 @@ public class Ping extends CommonBase { */ public short get_ponglen() { short ret = bindings.Ping_get_ponglen(this.ptr); + Reference.reachabilityFence(this); return ret; } @@ -31,6 +34,8 @@ public class Ping extends CommonBase { */ public void set_ponglen(short val) { bindings.Ping_set_ponglen(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); } /** @@ -39,6 +44,7 @@ public class Ping extends CommonBase { */ public short get_byteslen() { short ret = bindings.Ping_get_byteslen(this.ptr); + Reference.reachabilityFence(this); return ret; } @@ -48,6 +54,8 @@ public class Ping extends CommonBase { */ public void set_byteslen(short val) { bindings.Ping_set_byteslen(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); } /** @@ -55,18 +63,29 @@ public class Ping extends CommonBase { */ public static Ping of(short ponglen_arg, short byteslen_arg) { long ret = bindings.Ping_new(ponglen_arg, byteslen_arg); - Ping ret_hu_conv = new Ping(null, ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + Reference.reachabilityFence(ponglen_arg); + Reference.reachabilityFence(byteslen_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Ping ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Ping(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.Ping_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Creates a copy of the Ping */ public Ping clone() { long ret = bindings.Ping_clone(this.ptr); - Ping ret_hu_conv = new Ping(null, ret); - ret_hu_conv.ptrs_to.add(this); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Ping ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Ping(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -75,6 +94,7 @@ public class Ping extends CommonBase { */ public byte[] write() { byte[] ret = bindings.Ping_write(this.ptr); + Reference.reachabilityFence(this); return ret; } @@ -83,6 +103,8 @@ public class Ping extends CommonBase { */ public static Result_PingDecodeErrorZ read(byte[] ser) { long ret = bindings.Ping_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }