Merge pull request #117 from TheBlueMatt/2022-08-fix-npe
[ldk-java] / src / main / java / org / ldk / structs / SignedRawInvoice.java
index d214d549c1c84f5fac0f2da406fcc8608883e3dc..d5a17cb941fd90c9de60a4a90d15e11d2106bcdf 100644 (file)
@@ -30,10 +30,10 @@ public class SignedRawInvoice extends CommonBase {
         * Two objects with NULL inner values will be considered "equal" here.
         */
        public boolean eq(SignedRawInvoice b) {
-               boolean ret = bindings.SignedRawInvoice_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
+               boolean ret = bindings.SignedRawInvoice_eq(this.ptr, b == null ? 0 : b.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(b);
-               this.ptrs_to.add(b);
+               if (this != null) { this.ptrs_to.add(b); };
                return ret;
        }
 
@@ -54,8 +54,8 @@ public class SignedRawInvoice extends CommonBase {
                long ret = bindings.SignedRawInvoice_clone(this.ptr);
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new SignedRawInvoice(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               org.ldk.structs.SignedRawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SignedRawInvoice(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -70,8 +70,8 @@ public class SignedRawInvoice extends CommonBase {
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
                ThreeTuple_RawInvoice_u832InvoiceSignatureZ ret_hu_conv = new ThreeTuple_RawInvoice_u832InvoiceSignatureZ(null, ret);
-               ret_hu_conv.ptrs_to.add(this);
-               ;
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+               if (this != null) { this.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -82,8 +82,8 @@ public class SignedRawInvoice extends CommonBase {
                long ret = bindings.SignedRawInvoice_raw_invoice(this.ptr);
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawInvoice(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               org.ldk.structs.RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RawInvoice(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -103,8 +103,8 @@ public class SignedRawInvoice extends CommonBase {
                long ret = bindings.SignedRawInvoice_signature(this.ptr);
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceSignature(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               org.ldk.structs.InvoiceSignature ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceSignature(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -132,11 +132,11 @@ public class SignedRawInvoice extends CommonBase {
        /**
         * Read a SignedRawInvoice object from a string
         */
-       public static Result_SignedRawInvoiceNoneZ from_str(java.lang.String s) {
+       public static Result_SignedRawInvoiceParseErrorZ from_str(java.lang.String s) {
                long ret = bindings.SignedRawInvoice_from_str(s);
                Reference.reachabilityFence(s);
                if (ret >= 0 && ret <= 4096) { return null; }
-               Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
+               Result_SignedRawInvoiceParseErrorZ ret_hu_conv = Result_SignedRawInvoiceParseErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }