X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FDecodeError.java;h=5f7d8809b8b3b98763ef0c3614ea6b262d94d2c4;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=d39265af082e897be8681e33db684daddf64c080;hpb=fed2245c60159f6c074c9ed5c0f3ce273ad9841b;p=ldk-java diff --git a/src/main/java/org/ldk/structs/DecodeError.java b/src/main/java/org/ldk/structs/DecodeError.java index d39265af..5f7d8809 100644 --- a/src/main/java/org/ldk/structs/DecodeError.java +++ b/src/main/java/org/ldk/structs/DecodeError.java @@ -4,7 +4,12 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import javax.annotation.Nullable; + +/** + * An error in decoding a message or struct. + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DecodeError extends CommonBase { DecodeError(Object _dummy, long ptr) { super(ptr); } @@ -14,9 +19,13 @@ public class DecodeError extends CommonBase { if (ptr != 0) { bindings.DecodeError_free(ptr); } } + /** + * Creates a copy of the DecodeError + */ public DecodeError clone() { long ret = bindings.DecodeError_clone(this.ptr); - DecodeError ret_hu_conv = new DecodeError(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + DecodeError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new DecodeError(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; }