Merge pull request #123 from tnull/patch-1
[ldk-java] / src / main / java / org / ldk / structs / Result_InvoiceSemanticErrorZ.java
index 7776d218cbab3cd8ab94320a6a18af9b526e250b..a076e10649ce325de061e582f7d8a7a19edc07f6 100644 (file)
@@ -24,9 +24,9 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase {
                public final Invoice res;
                private Result_InvoiceSemanticErrorZ_OK(Object _dummy, long ptr) {
                        super(_dummy, ptr);
-                       long res = bindings.LDKCResult_InvoiceSemanticErrorZ_get_ok(ptr);
-                       Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new Invoice(null, res); }
-                       res_hu_conv.ptrs_to.add(this);
+                       long res = bindings.CResult_InvoiceSemanticErrorZ_get_ok(ptr);
+                       org.ldk.structs.Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Invoice(null, res); }
+                       if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); };
                        this.res = res_hu_conv;
                }
        }
@@ -35,7 +35,7 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase {
                public final SemanticError err;
                private Result_InvoiceSemanticErrorZ_Err(Object _dummy, long ptr) {
                        super(_dummy, ptr);
-                       this.err = bindings.LDKCResult_InvoiceSemanticErrorZ_get_err(ptr);
+                       this.err = bindings.CResult_InvoiceSemanticErrorZ_get_err(ptr);
                }
        }
 
@@ -43,10 +43,11 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase {
         * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
         */
        public static Result_InvoiceSemanticErrorZ ok(Invoice o) {
-               long ret = bindings.CResult_InvoiceSemanticErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               long ret = bindings.CResult_InvoiceSemanticErrorZ_ok(o == null ? 0 : o.ptr);
                Reference.reachabilityFence(o);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); };
                return ret_hu_conv;
        }